]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44926: `get_type_hints`: Add note about type aliases with forward refs (GH-27859...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 22 Aug 2021 18:29:59 +0000 (11:29 -0700)
committerGitHub <noreply@github.com>
Sun, 22 Aug 2021 18:29:59 +0000 (20:29 +0200)
(cherry picked from commit 16b9be4861e007ad483611ba0479feb2b90ea783)

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
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`.