diff options
author | Mark Shannon <mark@hotpy.org> | 2022-01-24 11:08:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-24 11:08:53 (GMT) |
commit | 0367a36fdc36b9c909c4d5acf7cde6ceeec0ba69 (patch) | |
tree | 1a87e9cb04dca5ef87abc4bd55540bdb41bd2172 /Lib | |
parent | d75a51bea3c2442f81d38ff850b81b8b7f3330f0 (diff) | |
download | cpython-0367a36fdc36b9c909c4d5acf7cde6ceeec0ba69.zip cpython-0367a36fdc36b9c909c4d5acf7cde6ceeec0ba69.tar.gz cpython-0367a36fdc36b9c909c4d5acf7cde6ceeec0ba69.tar.bz2 |
bpo-43683: Streamline YIELD_VALUE and SEND (GH-30723)
* Split YIELD_VALUE into ASYNC_GEN_WRAP; YIELD_VALUE for async generators.
* Split SEND into SEND; YIELD_VALUE.
* Document new opcodes.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/importlib/_bootstrap_external.py | 3 | ||||
-rw-r--r-- | Lib/opcode.py | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index 1560e60..cd4f69c 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -381,6 +381,7 @@ _code_type = type(_write_atomic.__code__) # Python 3.11a4 3473 (Add POP_JUMP_IF_NOT_NONE/POP_JUMP_IF_NONE opcodes) # Python 3.11a4 3474 (Add RESUME opcode) # Python 3.11a5 3475 (Add RETURN_GENERATOR opcode) +# Python 3.11a5 3476 (Add ASYNC_GEN_WRAP opcode) # Python 3.12 will start with magic number 3500 @@ -394,7 +395,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 = (3475).to_bytes(2, 'little') + b'\r\n' +MAGIC_NUMBER = (3476).to_bytes(2, 'little') + b'\r\n' _RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c _PYCACHE = '__pycache__' diff --git a/Lib/opcode.py b/Lib/opcode.py index 73b41d2..1bd48ee 100644 --- a/Lib/opcode.py +++ b/Lib/opcode.py @@ -101,7 +101,7 @@ def_op('RETURN_VALUE', 83) def_op('IMPORT_STAR', 84) def_op('SETUP_ANNOTATIONS', 85) def_op('YIELD_VALUE', 86) - +def_op('ASYNC_GEN_WRAP', 87) def_op('PREP_RERAISE_STAR', 88) def_op('POP_EXCEPT', 89) |