-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-143055: Implementation of PEP 798 #143056
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
base: main
Are you sure you want to change the base?
Conversation
* add error messages for dict unpacking in dict keys/values * change phrasing of existing error messages about using dict unpacking in a listcomp / genexp
JelleZijlstra
left a comment
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! A few nitpicky comments, I didn't read past Lib/test yet.
Doc/reference/expressions.rst
Outdated
| in the new dictionary in the order they are produced. | ||
| A dict comprehension may take one of two forms: | ||
|
|
||
| The first form uses two expressions separated with a colon followed by the |
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.
Probably better to make this an indented list since there is an : on the line above?
| The first form uses two expressions separated with a colon followed by the | |
| - The first form uses two expressions separated with a colon followed by the |
(will need more changes on later lines)
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.
Sounds good; I just pushed that change. Thanks for taking a look!
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
JelleZijlstra
left a comment
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 C code all looks good. I'll run it through the buildbots to make sure though.
|
🤖 New build scheduled with the buildbot fleet by @JelleZijlstra for commit 81e86b3 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F143056%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
ZeroIntensity
left a comment
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'm assuming the plan is to document this in 3.15 "What's New" later?
|
@ZeroIntensity Thanks for the review!
I haven't drafted a blurb for "What's New" yet, but I'm happy to do so. I can do that in a separate PR later, or I don't mind adding it to this one if that's better. |
This PR is an implementation of PEP 798 (Unpacking in Comprehensions), reflecting the SC's required modification to genexp semantics from the original proposal.
Feedback is welcome! :)
📚 Documentation preview 📚: https://cpython-previews--143056.org.readthedocs.build/