bpo-32565: Add missed versionadded directives for all new opcodes. (#5199)

This commit is contained in:
Serhiy Storchaka 2018-02-01 13:48:33 +02:00 committed by GitHub
parent ab328756d7
commit 12e7cd8a51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 31 additions and 0 deletions

View File

@ -339,12 +339,16 @@ The Python compiler currently generates the following bytecode instructions.
Duplicates the reference on top of the stack. Duplicates the reference on top of the stack.
.. versionadded:: 3.2
.. opcode:: DUP_TOP_TWO .. opcode:: DUP_TOP_TWO
Duplicates the two references on top of the stack, leaving them in the Duplicates the two references on top of the stack, leaving them in the
same order. same order.
.. versionadded:: 3.2
**Unary operations** **Unary operations**
@ -555,11 +559,14 @@ the original TOS1.
the CO_ITERABLE_COROUTINE flag, or resolves the CO_ITERABLE_COROUTINE flag, or resolves
``o.__await__``. ``o.__await__``.
.. versionadded:: 3.5
.. opcode:: GET_AITER .. opcode:: GET_AITER
Implements ``TOS = TOS.__aiter__()``. Implements ``TOS = TOS.__aiter__()``.
.. versionadded:: 3.5
.. versionchanged:: 3.7 .. versionchanged:: 3.7
Returning awaitable objects from ``__aiter__`` is no longer Returning awaitable objects from ``__aiter__`` is no longer
supported. supported.
@ -570,17 +577,23 @@ the original TOS1.
Implements ``PUSH(get_awaitable(TOS.__anext__()))``. See ``GET_AWAITABLE`` Implements ``PUSH(get_awaitable(TOS.__anext__()))``. See ``GET_AWAITABLE``
for details about ``get_awaitable`` for details about ``get_awaitable``
.. versionadded:: 3.5
.. opcode:: BEFORE_ASYNC_WITH .. opcode:: BEFORE_ASYNC_WITH
Resolves ``__aenter__`` and ``__aexit__`` from the object on top of the Resolves ``__aenter__`` and ``__aexit__`` from the object on top of the
stack. Pushes ``__aexit__`` and result of ``__aenter__()`` to the stack. stack. Pushes ``__aexit__`` and result of ``__aenter__()`` to the stack.
.. versionadded:: 3.5
.. opcode:: SETUP_ASYNC_WITH .. opcode:: SETUP_ASYNC_WITH
Creates a new frame object. Creates a new frame object.
.. versionadded:: 3.5
**Miscellaneous opcodes** **Miscellaneous opcodes**
@ -618,6 +631,8 @@ the original TOS1.
Calls ``dict.setitem(TOS1[-i], TOS, TOS1)``. Used to implement dict Calls ``dict.setitem(TOS1[-i], TOS, TOS1)``. Used to implement dict
comprehensions. comprehensions.
.. versionadded:: 3.1
For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:`MAP_ADD` For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:`MAP_ADD`
instructions, while the added value or key/value pair is popped off, the instructions, while the added value or key/value pair is popped off, the
container object remains on the stack so that it is available for further container object remains on the stack so that it is available for further
@ -640,6 +655,7 @@ iterations of the loop.
.. versionadded:: 3.3 .. versionadded:: 3.3
.. opcode:: SETUP_ANNOTATIONS .. opcode:: SETUP_ANNOTATIONS
Checks whether ``__annotations__`` is defined in ``locals()``, if not it is Checks whether ``__annotations__`` is defined in ``locals()``, if not it is
@ -649,6 +665,7 @@ iterations of the loop.
.. versionadded:: 3.6 .. versionadded:: 3.6
.. opcode:: IMPORT_STAR .. opcode:: IMPORT_STAR
Loads all symbols not starting with ``'_'`` directly from the module TOS to Loads all symbols not starting with ``'_'`` directly from the module TOS to
@ -694,6 +711,8 @@ iterations of the loop.
store it in (a) variable(s) (:opcode:`STORE_FAST`, :opcode:`STORE_NAME`, or store it in (a) variable(s) (:opcode:`STORE_FAST`, :opcode:`STORE_NAME`, or
:opcode:`UNPACK_SEQUENCE`). :opcode:`UNPACK_SEQUENCE`).
.. versionadded:: 3.2
.. opcode:: WITH_CLEANUP_START .. opcode:: WITH_CLEANUP_START
@ -924,23 +943,31 @@ All of the following opcodes use their arguments.
If TOS is true, sets the bytecode counter to *target*. TOS is popped. If TOS is true, sets the bytecode counter to *target*. TOS is popped.
.. versionadded:: 3.1
.. opcode:: POP_JUMP_IF_FALSE (target) .. opcode:: POP_JUMP_IF_FALSE (target)
If TOS is false, sets the bytecode counter to *target*. TOS is popped. If TOS is false, sets the bytecode counter to *target*. TOS is popped.
.. versionadded:: 3.1
.. opcode:: JUMP_IF_TRUE_OR_POP (target) .. opcode:: JUMP_IF_TRUE_OR_POP (target)
If TOS is true, sets the bytecode counter to *target* and leaves TOS on the If TOS is true, sets the bytecode counter to *target* and leaves TOS on the
stack. Otherwise (TOS is false), TOS is popped. stack. Otherwise (TOS is false), TOS is popped.
.. versionadded:: 3.1
.. opcode:: JUMP_IF_FALSE_OR_POP (target) .. opcode:: JUMP_IF_FALSE_OR_POP (target)
If TOS is false, sets the bytecode counter to *target* and leaves TOS on the If TOS is false, sets the bytecode counter to *target* and leaves TOS on the
stack. Otherwise (TOS is true), TOS is popped. stack. Otherwise (TOS is true), TOS is popped.
.. versionadded:: 3.1
.. opcode:: JUMP_ABSOLUTE (target) .. opcode:: JUMP_ABSOLUTE (target)
@ -1013,6 +1040,8 @@ All of the following opcodes use their arguments.
consulting the cell. This is used for loading free variables in class consulting the cell. This is used for loading free variables in class
bodies. bodies.
.. versionadded:: 3.4
.. opcode:: STORE_DEREF (i) .. opcode:: STORE_DEREF (i)
@ -1025,6 +1054,8 @@ All of the following opcodes use their arguments.
Empties the cell contained in slot *i* of the cell and free variable storage. Empties the cell contained in slot *i* of the cell and free variable storage.
Used by the :keyword:`del` statement. Used by the :keyword:`del` statement.
.. versionadded:: 3.2
.. opcode:: RAISE_VARARGS (argc) .. opcode:: RAISE_VARARGS (argc)