Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
Document PEP 698 and other new typing features in What's New#104957
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
@@ -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 |
AlexWaygoodMay 26, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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 astrong opinion), could we add this something like "this ensures thattypes.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 astypes.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. |
bedevere-bot commentedMay 28, 2023
GH-105045 is a backport of this pull request to the3.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.
Uh oh!
There was an error while loading.Please reload this page.
cc@stroxler
📚 Documentation preview 📚:https://cpython-previews--104957.org.readthedocs.build/