@@ -1058,25 +1058,23 @@ All of the following opcodes use their arguments.
1058
1058
1059
1059
.. opcode :: LOAD_CLOSURE (i)
1060
1060
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] ``.
1064
1063
1065
1064
Note that ``LOAD_CLOSURE `` is effectively an alias for ``LOAD_FAST ``.
1066
1065
It exists to keep bytecode a little more readable.
1067
1066
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 ``.
1070
1069
1071
1070
1072
1071
.. opcode :: LOAD_DEREF (i)
1073
1072
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.
1076
1074
Pushes a reference to the object the cell contains on the stack.
1077
1075
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 ``.
1080
1078
1081
1079
1082
1080
.. opcode :: LOAD_CLASSDEREF (i)
@@ -1087,29 +1085,28 @@ All of the following opcodes use their arguments.
1087
1085
1088
1086
.. versionadded :: 3.4
1089
1087
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 ``.
1092
1090
1093
1091
1094
1092
.. opcode :: STORE_DEREF (i)
1095
1093
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.
1098
1096
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 ``.
1101
1099
1102
1100
1103
1101
.. opcode :: DELETE_DEREF (i)
1104
1102
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.
1107
1104
Used by the :keyword: `del ` statement.
1108
1105
1109
1106
.. versionadded :: 3.2
1110
1107
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 ``.
1113
1110
1114
1111
1115
1112
.. opcode :: RAISE_VARARGS (argc)
0 commit comments