Thanks to visit codestin.com
Credit goes to github.com

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 <[email protected]>
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 <[email protected]>
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
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 <[email protected]>
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 <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
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 <[email protected]>
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 <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
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 <[email protected]>
JelleZijlstra added a commit to JelleZijlstra/cpython that referenced this issue May 24, 2025
- Mention (again) that `type.__annotations__` is unsafe. It is now safe
  when using only classes defined under PEP 649 semantics, but not with
  classes defined using `from __future__ import annotations`.
- Mention that annotations on instances no longer work. There was already
  an issue about this.
- Mention the general changes in the "Porting to Python 3.14" section.
- `annotationlib` was proposed by PEP-749, not PEP-649.
JelleZijlstra added a commit that referenced this issue May 26, 2025
- Mention (again) that `type.__annotations__` is unsafe. It is now safe
  when using only classes defined under PEP 649 semantics, but not with
  classes defined using `from __future__ import annotations`.
- Mention that annotations on instances no longer work. There was already
  an issue about this.
- Mention the general changes in the "Porting to Python 3.14" section.
- `annotationlib` was proposed by PEP-749, not PEP-649.

Co-authored-by: Emma Smith <[email protected]>
Co-authored-by: Carol Willing <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 26, 2025
- Mention (again) that `type.__annotations__` is unsafe. It is now safe
  when using only classes defined under PEP 649 semantics, but not with
  classes defined using `from __future__ import annotations`.
- Mention that annotations on instances no longer work. There was already
  an issue about this.
- Mention the general changes in the "Porting to Python 3.14" section.
- `annotationlib` was proposed by PEP-749, not PEP-649.
(cherry picked from commit 7291eab)

Co-authored-by: Jelle Zijlstra <[email protected]>
Co-authored-by: Emma Smith <[email protected]>
Co-authored-by: Carol Willing <[email protected]>
JelleZijlstra added a commit that referenced this issue May 26, 2025
gh-119180: Updates to PEP 649/749 docs (GH-134640)

- Mention (again) that `type.__annotations__` is unsafe. It is now safe
  when using only classes defined under PEP 649 semantics, but not with
  classes defined using `from __future__ import annotations`.
- Mention that annotations on instances no longer work. There was already
  an issue about this.
- Mention the general changes in the "Porting to Python 3.14" section.
- `annotationlib` was proposed by PEP-749, not PEP-649.
(cherry picked from commit 7291eab)

Co-authored-by: Jelle Zijlstra <[email protected]>
Co-authored-by: Emma Smith <[email protected]>
Co-authored-by: Carol Willing <[email protected]>
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