GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Document PEP 698 and other new typing features in What's New by JelleZijlstra · Pull Request #104957 · python/cpython

Conversation

@JelleZijlstra

@JelleZijlstra JelleZijlstra commented May 26, 2023 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

cc @stroxler


📚 Documentation preview 📚: https://cpython-previews--104957.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@JelleZijlstra
Document PEP 698 in Whats New
88d99c7
@JelleZijlstra JelleZijlstra added skip issue skip news needs backport to 3.12 only security fixes labels May 26, 2023
@JelleZijlstra
JelleZijlstra requested a review from AlexWaygood May 26, 2023 05:03
@bedevere-bot bedevere-bot added awaiting core review docs Documentation in the Doc dir labels May 26, 2023
@JelleZijlstra
Remove duplicate mention of override, add two others
0c8dfb1
@JelleZijlstra JelleZijlstra changed the title Document PEP 698 in Whats New Document PEP 698 and other new typing features in What's New May 26, 2023
@JelleZijlstra

JelleZijlstra commented May 26, 2023

Copy link
Copy Markdown
Member Author

I looked over git 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 of frozen_default.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AlexWaygood
AlexWaygood reviewed May 26, 2023
View reviewed changes
Comment thread Doc/whatsnew/3.12.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/whatsnew/3.12.rst
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

@AlexWaygood AlexWaygood May 26, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@JelleZijlstra JelleZijlstra May 26, 2023

Copy link
Copy Markdown
Member Author

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@AlexWaygood AlexWaygood May 26, 2023

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@JelleZijlstra @AlexWaygood
Update Doc/whatsnew/3.12.rst
e460c59
Co-authored-by: Alex Waygood <[email protected]>
AlexWaygood
AlexWaygood approved these changes May 26, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels May 26, 2023
stroxler
stroxler approved these changes May 26, 2023
View reviewed changes

@stroxler stroxler left a comment

Copy link
Copy Markdown
Contributor

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!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
hauntsaninja
hauntsaninja approved these changes May 28, 2023
View reviewed changes
@hauntsaninja
hauntsaninja merged commit 595ffdd into python:main May 28, 2023
@miss-islington

miss-islington commented May 28, 2023

Copy link
Copy Markdown
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!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting merge label May 28, 2023
@bedevere-bot

bedevere-bot commented May 28, 2023

Copy link
Copy Markdown

GH-105045 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label May 28, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 28, 2023
@JelleZijlstra @miss-islington
Document PEP 698 and other new typing features in What's New (pythonG…
63c9055
…H-104957)

(cherry picked from commit 595ffdd)

Co-authored-by: Jelle Zijlstra <[email protected]>
hauntsaninja pushed a commit that referenced this pull request May 28, 2023
@miss-islington @JelleZijlstra
[3.12] Document PEP 698 and other new typing features in What's New (G…
74bbc60
…H-104957) (#105045)

Co-authored-by: Jelle Zijlstra <[email protected]>
@erlend-aasland erlend-aasland mentioned this pull request Jun 6, 2023
3.12 backport gh 105236 #105358
Closed
rinarakaki
rinarakaki reviewed Oct 3, 2023
View reviewed changes
Comment thread Doc/whatsnew/3.12.rst

from typing import override

class Base:

@rinarakaki rinarakaki Oct 3, 2023

Copy link
Copy Markdown

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hauntsaninja hauntsaninja hauntsaninja approved these changes
@AlexWaygood AlexWaygood AlexWaygood approved these changes
+2 more reviewers
@rinarakaki rinarakaki rinarakaki left review comments
@stroxler stroxler stroxler approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip issue skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@JelleZijlstra @miss-islington @bedevere-bot @stroxler @hauntsaninja @rinarakaki @AlexWaygood
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.