Skip to content
Prev Previous commit
Next Next commit
Update the dis docs.
  • Loading branch information
ericsnowcurrently committed Jun 3, 2021
commit 5183325f3f1c05aede20e4677e77302a20fc4315
35 changes: 16 additions & 19 deletions Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1058,25 +1058,23 @@ All of the following opcodes use their arguments.

.. opcode:: LOAD_CLOSURE (i)

Pushes a reference to the cell contained in slot ``i - len(co_varnames)``
of the cell and free variable storage. The name of the variable is
``(co_varnames + co_cellvars + co_freevars)[i]``.
Pushes a reference to the cell contained in slot ``i`` of the "fast locals"
storage. The name of the variable is ``co_fastlocalnames[i]``.

Note that ``LOAD_CLOSURE`` is effectively an alias for ``LOAD_FAST``.
It exists to keep bytecode a little more readable.

.. versionchanged:: 3.10
``i`` is offset by the length of ``co_varnames``.
.. versionchanged:: 3.11
``i`` is no longer offset by the length of ``co_varnames``.


.. opcode:: LOAD_DEREF (i)

Loads the cell contained in slot ``i - len(co_varnames)`` of the cell
and free variable storage.
Loads the cell contained in slot ``i`` of the "fast locals" storage.
Pushes a reference to the object the cell contains on the stack.

.. versionchanged:: 3.10
``i`` is offset by the length of ``co_varnames``.
.. versionchanged:: 3.11
``i`` is no longer offset by the length of ``co_varnames``.


.. opcode:: LOAD_CLASSDEREF (i)
Expand All @@ -1087,29 +1085,28 @@ All of the following opcodes use their arguments.

.. versionadded:: 3.4

.. versionchanged:: 3.10
``i`` is offset by the length of ``co_varnames``.
.. versionchanged:: 3.11
``i`` is no longer offset by the length of ``co_varnames``.


.. opcode:: STORE_DEREF (i)

Stores TOS into the cell contained in slot ``i - len(co_varnames)``
of the cell and free variable storage.
Stores TOS into the cell contained in slot ``i`` of the "fast locals"
storage.

.. versionchanged:: 3.10
``i`` is offset by the length of ``co_varnames``.
.. versionchanged:: 3.11
``i`` is no longer offset by the length of ``co_varnames``.


.. opcode:: DELETE_DEREF (i)

Empties the cell contained in slot ``i - len(co_varnames)``
of the cell and free variable storage.
Empties the cell contained in slot ``i`` of the "fast locals" storage.
Used by the :keyword:`del` statement.

.. versionadded:: 3.2

.. versionchanged:: 3.10
``i`` is offset by the length of ``co_varnames``.
.. versionchanged:: 3.11
``i`` is no longer offset by the length of ``co_varnames``.


.. opcode:: RAISE_VARARGS (argc)
Expand Down