-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-39320: Handle unpacking of **values in compiler #18141
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
bpo-39320: Handle unpacking of **values in compiler #18141
Conversation
b6ad237
to
95e421c
Compare
@@ -0,0 +1,12 @@ | |||
|
|||
Replace two complex bytecodes for building dicts with two simpler ones. | |||
|
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.
Different paragraphs render badly when joining the NEWS entries, sadly
🤖 New build scheduled with the buildbot fleet by @markshannon for commit 2d2fe4c 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
The failures in |
OK, merging. |
* Add DICT_UPDATE and DICT_MERGE bytecodes. Use them for ** unpacking. * Remove BUILD_MAP_UNPACK and BUILD_MAP_UNPACK_WITH_CALL, as they are now unused. * Update magic number for ** unpacking opcodes. * Update dis.rst to incorporate new bytecodes. * Add blurb entry.
This is the second part of the implementation of bpo-39320.
Part 1 was #17984
This PR replaces BUILD_MAP_UNPACK and BUILD_MAP_UNPACK_WITH_CALL
with DICT_MERGE and DICT_UPDATE.
DICT_UPDATE n
callsitem_n.update(tos)
whereitem_n
is then
th item on the stack andtos
is popped from the stack.DICT_MERGE n
is the same, but raises an exception if there are duplicate keys.https://bugs.python.org/issue39320