Skip to content

Add __orig_bases__ to non-generic TypedDict #103699

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

Closed
adriangb opened this issue Apr 22, 2023 · 0 comments
Closed

Add __orig_bases__ to non-generic TypedDict #103699

adriangb opened this issue Apr 22, 2023 · 0 comments
Labels
3.12 only security fixes stdlib Python modules in the Lib dir topic-typing type-feature A feature request or enhancement

Comments

@adriangb
Copy link
Contributor

adriangb commented Apr 22, 2023

Feature or enhancement

As discussed at the typing summit, non generic TypedDict's completely loose all inheritance information. Funny enough, generic TypedDict's actually preserve it via __orig_bases__ because Generic does that. So this just brings non-generic TypedDicts to be the same.

Pitch

This is very useful for runtime type checkers, and as per above the attribute already exists for generic TypedDicts

Previous discussion

Discussed at PyCon 2023 typing summit, this was an uncontroversial yes at the time.

Linked PRs

@adriangb adriangb added the type-feature A feature request or enhancement label Apr 22, 2023
@AlexWaygood AlexWaygood added stdlib Python modules in the Lib dir topic-typing 3.12 only security fixes labels Apr 22, 2023
AlexWaygood added a commit that referenced this issue Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 only security fixes stdlib Python modules in the Lib dir topic-typing type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants