mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-39320: Handle unpacking of *values in compiler (GH-17984)
* Add three new bytecodes: LIST_TO_TUPLE, LIST_EXTEND, SET_UPDATE. Use them to implement star unpacking expressions. * Remove four bytecodes BUILD_LIST_UNPACK, BUILD_TUPLE_UNPACK, BUILD_SET_UNPACK and BUILD_TUPLE_UNPACK_WITH_CALL opcodes as they are now unused. * Update magic number and dis.rst for new bytecodes.
This commit is contained in:
parent
f9e07e116c
commit
13bc13960c
10 changed files with 2349 additions and 2360 deletions
7
Include/opcode.h
generated
7
Include/opcode.h
generated
|
@ -60,6 +60,7 @@ extern "C" {
|
|||
#define INPLACE_AND 77
|
||||
#define INPLACE_XOR 78
|
||||
#define INPLACE_OR 79
|
||||
#define LIST_TO_TUPLE 82
|
||||
#define RETURN_VALUE 83
|
||||
#define IMPORT_STAR 84
|
||||
#define SETUP_ANNOTATIONS 85
|
||||
|
@ -116,18 +117,16 @@ extern "C" {
|
|||
#define SET_ADD 146
|
||||
#define MAP_ADD 147
|
||||
#define LOAD_CLASSDEREF 148
|
||||
#define BUILD_LIST_UNPACK 149
|
||||
#define BUILD_MAP_UNPACK 150
|
||||
#define BUILD_MAP_UNPACK_WITH_CALL 151
|
||||
#define BUILD_TUPLE_UNPACK 152
|
||||
#define BUILD_SET_UNPACK 153
|
||||
#define SETUP_ASYNC_WITH 154
|
||||
#define FORMAT_VALUE 155
|
||||
#define BUILD_CONST_KEY_MAP 156
|
||||
#define BUILD_STRING 157
|
||||
#define BUILD_TUPLE_UNPACK_WITH_CALL 158
|
||||
#define LOAD_METHOD 160
|
||||
#define CALL_METHOD 161
|
||||
#define LIST_EXTEND 162
|
||||
#define SET_UPDATE 163
|
||||
|
||||
/* EXCEPT_HANDLER is a special, implicit block type which is created when
|
||||
entering an except handler. It is not an opcode but we define it here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue