bpo-44926: get_type_hints: Add note about type aliases with forward refs (GH-27859) (GH-27860)

(cherry picked from commit 16b9be4861)

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
This commit is contained in:
Miss Islington (bot) 2021-08-22 11:29:59 -07:00 committed by GitHub
parent d63114caf9
commit 9ffe582a01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2013,6 +2013,13 @@ Introspection helpers
'name': Annotated[str, 'some marker']
}
.. note::
:func:`get_type_hints` does not work with imported
:ref:`type aliases <type-aliases>` that include forward references.
Enabling postponed evaluation of annotations (:pep:`563`) may remove
the need for most forward references.
.. versionchanged:: 3.9
Added ``include_extras`` parameter as part of :pep:`593`.