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.
This commit is contained in:
Mark Shannon 2022-01-24 11:08:53 +00:00 committed by GitHub
parent d75a51bea3
commit 0367a36fdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 72 additions and 43 deletions

View file

@ -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__'