summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2020-01-23 09:25:17 (GMT)
committerGitHub <noreply@github.com>2020-01-23 09:25:17 (GMT)
commit13bc13960cc83dbd1cb5701d9a59ac9b9144b205 (patch)
tree582d8286864561b8a29be0491f837c22efd1f07e /Include
parentf9e07e116c32b6dc4561d0bdeb452ccde13b0e7c (diff)
downloadcpython-13bc13960cc83dbd1cb5701d9a59ac9b9144b205.zip
cpython-13bc13960cc83dbd1cb5701d9a59ac9b9144b205.tar.gz
cpython-13bc13960cc83dbd1cb5701d9a59ac9b9144b205.tar.bz2
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.
Diffstat (limited to 'Include')
-rw-r--r--Include/opcode.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/Include/opcode.h b/Include/opcode.h
index 0535484..1c5cd33 100644
--- a/Include/opcode.h
+++ b/Include/opcode.h
@@ -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