From: Maximilian Hils Date: Fri, 20 Aug 2021 14:36:51 +0000 (+0200) Subject: bpo-44926: `get_type_hints`: Add note about type aliases with forward refs (#27859) X-Git-Tag: v3.11.0a1~377 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16b9be4861e007ad483611ba0479feb2b90ea783;p=thirdparty%2FPython%2Fcpython.git bpo-44926: `get_type_hints`: Add note about type aliases with forward refs (#27859) --- diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index e8d7c9ee01bd..47d6c3a2e389 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -2013,6 +2013,13 @@ Introspection helpers 'name': Annotated[str, 'some marker'] } + .. note:: + + :func:`get_type_hints` does not work with imported + :ref:`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`.