-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
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
Comments
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.
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>
but did not actually apply the new magic number.
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>
PR python#119321 added a comment about the magic number bump but did not actually apply the new magic number.
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 |
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 :) |
We should use |
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. |
The SC asked that the Appendix in PEP-749 be added to the docs.
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>
…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
…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>
PEP-649 has been accepted and should be implemented in Python 3.14. Let's use this issue to track the implementation:
__annotate__
attributes gh-119180: PEP 649: Add __annotate__ attributes #119209format
argument toinspect.get_annotations
gh-119180: Addannotationlib
module to support PEP 649 #119891inspect.AnnotationsFormat
should be a "global enum". Is that desirable? TBD. https://github.com/python/cpython/pull/119361/files#r1614753031)from __future__ import annotations
; an introduction to annotationlib; an update to Larry's annotations HOWTOannotationlib
module to support PEP 649 #119891inspect
. (If it can't be removed, get rid of the awkward dance we do fortyping.Protocol
to importinspect.getattr_static
lazily.)annotationlib
module to support PEP 649 #119891annotationlib
module to support PEP 649 #119891 (comment)annotationlib
module to support PEP 649 #119891, PEP 649:functools.update_wrapper
implementation #124342pep649-typevar
branch in my fork)__dict__
__dict__
access (Support Python 3.13 quora/pyanalyze#773)__annotate__
#124157Things to revisit:
__annotate__
parameter__annotations__
invalidate__annotate__
?I am planning to work on the interpreter core first.
cc @larryhastings @carljm @samuelcolvin
Linked PRs
annotationlib
module to support PEP 649 #119891__annotations__
in__main__
#124634annotationlib.Format
#131755The text was updated successfully, but these errors were encountered: