gh-114053: Fix bad interaction of PEP-695, PEP-563 and `get_type_hints` (#118009)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Alex Waygood 2024-04-19 14:03:44 +01:00 committed by GitHub
parent 15b3555e4a
commit 1e3e7ce11e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 81 additions and 10 deletions

View file

@ -3024,7 +3024,9 @@ Introspection helpers
This is often the same as ``obj.__annotations__``. In addition,
forward references encoded as string literals are handled by evaluating
them in ``globals`` and ``locals`` namespaces. For a class ``C``, return
them in ``globals``, ``locals`` and (where applicable)
:ref:`type parameter <type-params>` namespaces.
For a class ``C``, return
a dictionary constructed by merging all the ``__annotations__`` along
``C.__mro__`` in reverse order.