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

Backport generic TypedDicts #46

Merged
merged 4 commits into from May 27, 2022
Merged

Conversation

AlexWaygood
Copy link
Member

As with #44, the tests here are basically copied from the cpython main branch. Unlike #44, however, the implementation needs to be a little bit different. On Python <= 3.10, typing.Generic raises a TypeError if Generic.__init_subclass__ is called from _TypedDictMeta.__new__, so I had to work around this.

Backport of python/cpython#27663, by Samodya Abey. Closes #7. Cc. @davidfstr.

@AlexWaygood AlexWaygood marked this pull request as ready for review May 27, 2022 14:45
@JelleZijlstra JelleZijlstra self-requested a review May 27, 2022 16:01
@JelleZijlstra JelleZijlstra merged commit 1baf0a5 into python:main May 27, 2022
@AlexWaygood AlexWaygood deleted the typeddict branch May 27, 2022 22:30
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.

Backport generic NamedTuple and TypedDict support
2 participants