]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44926: `get_type_hints`: Add note about type aliases with forward refs (#27859)
authorMaximilian Hils <git@maximilianhils.com>
Fri, 20 Aug 2021 14:36:51 +0000 (16:36 +0200)
committerGitHub <noreply@github.com>
Fri, 20 Aug 2021 14:36:51 +0000 (07:36 -0700)
Doc/library/typing.rst

index e8d7c9ee01bd1f53411b310cc5768917f6dd9702..47d6c3a2e389851a13200b9e90951b0d94f8704e 100644 (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`.