diff options
author | Mark Shannon <mark@hotpy.org> | 2020-01-23 09:25:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-23 09:25:17 (GMT) |
commit | 13bc13960cc83dbd1cb5701d9a59ac9b9144b205 (patch) | |
tree | 582d8286864561b8a29be0491f837c22efd1f07e /Lib/importlib | |
parent | f9e07e116c32b6dc4561d0bdeb452ccde13b0e7c (diff) | |
download | cpython-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 'Lib/importlib')
-rw-r--r-- | Lib/importlib/_bootstrap_external.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index b86612b..6c703fa 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -275,6 +275,8 @@ _code_type = type(_write_atomic.__code__) # Python 3.9a0 3421 (simplified bytecode for with blocks #32949) # Python 3.9a0 3422 (remove BEGIN_FINALLY, END_FINALLY, CALL_FINALLY, POP_FINALLY bytecodes #33387) # Python 3.9a2 3423 (add IS_OP, CONTAINS_OP and JUMP_IF_NOT_EXC_MATCH bytecodes #39156) +# Python 3.9a2 3424 (simplify bytecodes for *value unpacking) + # # MAGIC must change whenever the bytecode emitted by the compiler may no # longer be understood by older implementations of the eval loop (usually @@ -283,7 +285,7 @@ _code_type = type(_write_atomic.__code__) # Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array # in PC/launcher.c must also be updated. -MAGIC_NUMBER = (3423).to_bytes(2, 'little') + b'\r\n' +MAGIC_NUMBER = (3424).to_bytes(2, 'little') + b'\r\n' _RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c _PYCACHE = '__pycache__' |