-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
Document PEP 698 and other new typing features in What's New #104957
Conversation
@@ -755,6 +778,13 @@ typing | |||
or more members may be slower than in Python 3.11. (Contributed by Alex | |||
Waygood in :gh:`74690` and :gh:`103193`.) | |||
|
|||
* All :data:`typing.TypedDict` and :data:`typing.NamedTuple` classes now have the | |||
``__orig_bases__`` attribute. (Contributed by Adrian Garcia Badaracco in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this attribute is undocumented (and I'd prefer it to stay that way, though that's not a strong opinion), could we add this something like "this ensures that types.get_original_bases(typeddict_class)
will now always return the correct result"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could say "now work reliably with :func:types.get_original_bases
", although that's a bit of a vacuous statement as types.get_original_bases
didn't exist before 3.12 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, I guess you're right, it's probably fine as it is
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PEP 698 section looks good to me, thanks!
Thanks @JelleZijlstra for the PR, and @hauntsaninja for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
GH-105045 is a backport of this pull request to the 3.12 branch. |
|
||
from typing import override | ||
|
||
class Base: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 space tab would be more consistent.
cc @stroxler
📚 Documentation preview 📚: https://cpython-previews--104957.org.readthedocs.build/