Skip to content

Commit 5183325

Browse files
Update the dis docs.
1 parent 775d4db commit 5183325

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

Doc/library/dis.rst

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,25 +1058,23 @@ All of the following opcodes use their arguments.
10581058

10591059
.. opcode:: LOAD_CLOSURE (i)
10601060

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

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

1068-
.. versionchanged:: 3.10
1069-
``i`` is offset by the length of ``co_varnames``.
1067+
.. versionchanged:: 3.11
1068+
``i`` is no longer offset by the length of ``co_varnames``.
10701069

10711070

10721071
.. opcode:: LOAD_DEREF (i)
10731072

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

1078-
.. versionchanged:: 3.10
1079-
``i`` is offset by the length of ``co_varnames``.
1076+
.. versionchanged:: 3.11
1077+
``i`` is no longer offset by the length of ``co_varnames``.
10801078

10811079

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

10881086
.. versionadded:: 3.4
10891087

1090-
.. versionchanged:: 3.10
1091-
``i`` is offset by the length of ``co_varnames``.
1088+
.. versionchanged:: 3.11
1089+
``i`` is no longer offset by the length of ``co_varnames``.
10921090

10931091

10941092
.. opcode:: STORE_DEREF (i)
10951093

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

1099-
.. versionchanged:: 3.10
1100-
``i`` is offset by the length of ``co_varnames``.
1097+
.. versionchanged:: 3.11
1098+
``i`` is no longer offset by the length of ``co_varnames``.
11011099

11021100

11031101
.. opcode:: DELETE_DEREF (i)
11041102

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

11091106
.. versionadded:: 3.2
11101107

1111-
.. versionchanged:: 3.10
1112-
``i`` is offset by the length of ``co_varnames``.
1108+
.. versionchanged:: 3.11
1109+
``i`` is no longer offset by the length of ``co_varnames``.
11131110

11141111

11151112
.. opcode:: RAISE_VARARGS (argc)

0 commit comments

Comments
 (0)