@@ -1140,22 +1140,24 @@ All of the following opcodes use their arguments.
1140
1140
1141
1141
.. opcode :: LOAD_METHOD (namei)
1142
1142
1143
- Loads a method named ``co_names[namei] `` from TOS object. TOS is popped and
1144
- method and TOS are pushed when interpreter can call unbound method directly.
1145
- TOS will be used as the first argument (``self ``) by :opcode: `CALL_METHOD `.
1146
- Otherwise, ``NULL `` and method is pushed (method is bound method or
1147
- something else).
1143
+ Loads a method named ``co_names[namei] `` from the TOS object. TOS is popped.
1144
+ This bytecode distinguishes two cases: if TOS has a method with the correct
1145
+ name, the bytecode pushes the unbound method and TOS. TOS will be used as
1146
+ the first argument (``self ``) by :opcode: `CALL_METHOD ` when calling the
1147
+ unbound method. Otherwise, ``NULL `` and the object return by the attribute
1148
+ lookup are pushed.
1148
1149
1149
1150
.. versionadded :: 3.7
1150
1151
1151
1152
1152
1153
.. opcode :: CALL_METHOD (argc)
1153
1154
1154
- Calls a method. *argc * is number of positional arguments.
1155
+ Calls a method. *argc * is the number of positional arguments.
1155
1156
Keyword arguments are not supported. This opcode is designed to be used
1156
1157
with :opcode: `LOAD_METHOD `. Positional arguments are on top of the stack.
1157
- Below them, two items described in :opcode: `LOAD_METHOD ` on the stack.
1158
- All of them are popped and return value is pushed.
1158
+ Below them, the two items described in :opcode: `LOAD_METHOD ` are on the
1159
+ stack (either ``self `` and an unbound method object or ``NULL `` and an
1160
+ arbitrary callable). All of them are popped and the return value is pushed.
1159
1161
1160
1162
.. versionadded :: 3.7
1161
1163
0 commit comments