Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix get_type_hints() on x-module inherited TypedDict in 3.9 and 3.10 #94

Merged
merged 6 commits into from
Nov 12, 2022

Conversation

carljm
Copy link
Member

@carljm carljm commented Nov 11, 2022

The fix in python/cpython#27017 was never backported into typing-extensions.

In 3.11 it doesn't matter because we just use TypedDict from typing.py. But in 3.9 and 3.10, it means this cross-module inheritance scenario with stringified annotations and get_type_hints will fail if you use TypedDict from typing_extensions but work if you use it from typing.

I don't attempt here to backport the fix to pre-3.9 versions where typing.py doesn't have it; that would require pulling in lots more code (ForwardRef and some utility functions) into typing_extensions.py. Just aiming for parity with typing.py for 3.9 and 3.10.

* main:
  Add Python 3.11 to tox.ini (python#95)
  Remove Python 3.6 from tox.ini (python#93)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants