Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
hauntsaninja merged 3 commits intopython:mainfromJelleZijlstra:pep698
May 28, 2023

Conversation

JelleZijlstra
Copy link
Member

@JelleZijlstraJelleZijlstra commentedMay 26, 2023
edited by github-actionsbot
Loading

@JelleZijlstraJelleZijlstra changed the titleDocument PEP 698 in Whats NewDocument PEP 698 and other new typing features in What's NewMay 26, 2023
@JelleZijlstra
Copy link
MemberAuthor

I looked overgit diff 3.11 3.12 Lib/typing.py and noticed two more changes that deserve to be mentioned:@adriangb's work on__orig_bases__ and@debonte's addition offrozen_default.

@@ -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
Copy link
Member

@AlexWaygoodAlexWaygoodMay 26, 2023
edited
Loading

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"?

Copy link
MemberAuthor

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 :)

Copy link
Member

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>
Copy link
Contributor

@stroxlerstroxler left a 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!

@hauntsaninjahauntsaninja merged commit595ffdd intopython:mainMay 28, 2023
@miss-islington
Copy link
Contributor

Thanks@JelleZijlstra for the PR, and@hauntsaninja for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@bedevere-bot
Copy link

GH-105045 is a backport of this pull request to the3.12 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.12only security fixes labelMay 28, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 28, 2023
…H-104957)(cherry picked from commit595ffdd)Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
hauntsaninja pushed a commit that referenced this pull requestMay 28, 2023

from typing import override

class Base:

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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@rinarakakirinarakakirinarakaki left review comments

@stroxlerstroxlerstroxler approved these changes

@hauntsaninjahauntsaninjahauntsaninja approved these changes

@AlexWaygoodAlexWaygoodAlexWaygood approved these changes

Assignees
No one assigned
Labels
docsDocumentation in the Doc dirskip issueskip news
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

7 participants
@JelleZijlstra@miss-islington@bedevere-bot@stroxler@hauntsaninja@rinarakaki@AlexWaygood

[8]ページ先頭

©2009-2025 Movatter.jp