-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
annotations: expand documentation on "simple" assignment targets #120535
Conversation
This behavior is rather surprising and it was not clearly specified.
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.
Thanks, I agree that this can be usefully clarified.
Separately to improving the documentation, we could consider changing the implementation to use a bool
for the simple
field. I also wonder why annotations for complex targets are evaluated at all if these annotations are never stored in the __annotations__
dictionary -- but this problem will shortly be going away with PEP-649, so I suppose we don't really need to worry about it too much :-)
Co-authored-by: Alex Waygood <[email protected]>
I think that's hard because bool isn't a builtin type in ASDL. |
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.
I think that's hard because bool isn't a builtin type in ASDL.
A shame, but oh well
Thanks @JelleZijlstra for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
…honGH-120535) This behavior is rather surprising and it was not clearly specified. (cherry picked from commit 9e0b11e) Co-authored-by: Jelle Zijlstra <[email protected]> Co-authored-by: Alex Waygood <[email protected]>
GH-120555 is a backport of this pull request to the 3.13 branch. |
…honGH-120535) This behavior is rather surprising and it was not clearly specified. (cherry picked from commit 9e0b11e) Co-authored-by: Jelle Zijlstra <[email protected]> Co-authored-by: Alex Waygood <[email protected]>
GH-120556 is a backport of this pull request to the 3.12 branch. |
…ts (GH-120535) (#120556) This behavior is rather surprising and it was not clearly specified. (cherry picked from commit 9e0b11e) Co-authored-by: Jelle Zijlstra <[email protected]> Co-authored-by: Alex Waygood <[email protected]>
…ts (GH-120535) (#120555) This behavior is rather surprising and it was not clearly specified. (cherry picked from commit 9e0b11e) Co-authored-by: Jelle Zijlstra <[email protected]> Co-authored-by: Alex Waygood <[email protected]>
…hon#120535) This behavior is rather surprising and it was not clearly specified. Co-authored-by: Alex Waygood <[email protected]>
…hon#120535) This behavior is rather surprising and it was not clearly specified. Co-authored-by: Alex Waygood <[email protected]>
…hon#120535) This behavior is rather surprising and it was not clearly specified. Co-authored-by: Alex Waygood <[email protected]>
This behavior is rather surprising and it was not clearly specified.
📚 Documentation preview 📚: https://cpython-previews--120535.org.readthedocs.build/