Skip to content

Implement PEP 649 and PEP 749 #119180

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

Open
21 of 30 tasks
JelleZijlstra opened this issue May 19, 2024 · 9 comments
Open
21 of 30 tasks

Implement PEP 649 and PEP 749 #119180

JelleZijlstra opened this issue May 19, 2024 · 9 comments
Assignees
Labels
3.14 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) stdlib Python modules in the Lib dir topic-typing type-feature A feature request or enhancement

Comments

@JelleZijlstra
Copy link
Member

JelleZijlstra commented May 19, 2024

PEP-649 has been accepted and should be implemented in Python 3.14. Let's use this issue to track the implementation:

Things to revisit:

I am planning to work on the interpreter core first.

cc @larryhastings @carljm @samuelcolvin

Linked PRs

@JelleZijlstra JelleZijlstra added topic-typing 3.14 bugs and security fixes labels May 19, 2024
@JelleZijlstra JelleZijlstra self-assigned this May 19, 2024
JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this issue May 21, 2024
The PEP 649 implementation will require a way to load NotImplementedError
from the bytecode. @markshannon suggested implementing this by converting
LOAD_ASSERTION_ERROR into a more general mechanism for loading constants.

This PR adds this new opcode. I will work on the rest of the implementation
of the PEP separately.
JelleZijlstra added a commit that referenced this issue May 22, 2024
The PEP 649 implementation will require a way to load NotImplementedError
from the bytecode. @markshannon suggested implementing this by converting
LOAD_ASSERTION_ERROR into a more general mechanism for loading constants.

This PR adds this new opcode. I will work on the rest of the implementation
of the PEP separately.

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this issue May 22, 2024
but did not actually apply the new magic number.
JelleZijlstra added a commit that referenced this issue May 25, 2024
PR #119321 added a comment about the magic number bump
but did not actually apply the new magic number.
@JelleZijlstra JelleZijlstra changed the title Implement PEP 649 Implement PEP 649 and PEP 749 Jun 11, 2024
JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this issue Jun 21, 2024
mrahtz pushed a commit to mrahtz/cpython that referenced this issue Jun 30, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
The PEP 649 implementation will require a way to load NotImplementedError
from the bytecode. @markshannon suggested implementing this by converting
LOAD_ASSERTION_ERROR into a more general mechanism for loading constants.

This PR adds this new opcode. I will work on the rest of the implementation
of the PEP separately.

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
PR python#119321 added a comment about the magic number bump
but did not actually apply the new magic number.
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
@AlexWaygood
Copy link
Member

Just a cosmetic inconsistency I noticed: comparisons with annotationslib.Format are done using both equality and identity:

The enum docs recommend that comparisons like this should be done using identity since each enum member is a singleton, but I don't think it's a huge issue

@Viicos
Copy link
Contributor

Viicos commented Jan 7, 2025

Yes iirc only an issue when you reload modules or something like this. This can be ignored, just wanted to notify it in case we want proper consistency here :)

@JelleZijlstra
Copy link
Member Author

We should use == since the integer values may be used interchangeably (they're what gets used by some low-level code). I'd accept a PR to change to ==.

Viicos added a commit to Viicos/cpython that referenced this issue Mar 26, 2025
diegorusso pushed a commit to diegorusso/cpython that referenced this issue Apr 1, 2025
seehwan pushed a commit to seehwan/cpython that referenced this issue Apr 16, 2025
@picnixz picnixz added type-feature A feature request or enhancement interpreter-core (Objects, Python, Grammar, and Parser dirs) stdlib Python modules in the Lib dir labels Apr 27, 2025
JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this issue May 4, 2025
@JelleZijlstra
Copy link
Member Author

PEP 749 has been accepted and the implementation on main is done as far as I'm concerned, though I'm sure we'll discover more things to tweak.

We need to add more docs; I'll hopefully work on that soon.

JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this issue May 7, 2025
The SC asked that the Appendix in PEP-749 be added to the docs.
JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this issue May 10, 2025
JelleZijlstra added a commit that referenced this issue May 11, 2025
The SC asked that the Appendix in PEP-749 be added to the docs.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 11, 2025
The SC asked that the Appendix in PEP-749 be added to the docs.
(cherry picked from commit 3396df5)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
JelleZijlstra added a commit that referenced this issue May 11, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 11, 2025
…ythonGH-133841)

(cherry picked from commit 0eb448c)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
pythongh-119180: Fix values of Format members in docs
JelleZijlstra added a commit that referenced this issue May 11, 2025
…3902)

gh-119180: More documentation for PEP 649/749 (GH-133552)

The SC asked that the Appendix in PEP-749 be added to the docs.
(cherry picked from commit 3396df5)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
JelleZijlstra added a commit that referenced this issue May 11, 2025
…GH-133841) (#133903)

gh-119180: annotationlib: Fix values of Format members in docs (GH-133841)
(cherry picked from commit 0eb448c)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.14 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) 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

6 participants