@@ -1176,22 +1176,24 @@ All of the following opcodes use their arguments.
1176
1176
1177
1177
.. opcode :: LOAD_METHOD (namei)
1178
1178
1179
- Loads a method named ``co_names[namei] `` from TOS object. TOS is popped and
1180
- method and TOS are pushed when interpreter can call unbound method directly.
1181
- TOS will be used as the first argument (``self ``) by :opcode: `CALL_METHOD `.
1182
- Otherwise, ``NULL `` and method is pushed (method is bound method or
1183
- something else).
1179
+ Loads a method named ``co_names[namei] `` from the TOS object. TOS is popped.
1180
+ This bytecode distinguishes two cases: if TOS has a method with the correct
1181
+ name, the bytecode pushes the unbound method and TOS. TOS will be used as
1182
+ the first argument (``self ``) by :opcode: `CALL_METHOD ` when calling the
1183
+ unbound method. Otherwise, ``NULL `` and the object return by the attribute
1184
+ lookup are pushed.
1184
1185
1185
1186
.. versionadded :: 3.7
1186
1187
1187
1188
1188
1189
.. opcode :: CALL_METHOD (argc)
1189
1190
1190
- Calls a method. *argc * is number of positional arguments.
1191
+ Calls a method. *argc * is the number of positional arguments.
1191
1192
Keyword arguments are not supported. This opcode is designed to be used
1192
1193
with :opcode: `LOAD_METHOD `. Positional arguments are on top of the stack.
1193
- Below them, two items described in :opcode: `LOAD_METHOD ` on the stack.
1194
- All of them are popped and return value is pushed.
1194
+ Below them, the two items described in :opcode: `LOAD_METHOD ` are on the
1195
+ stack (either ``self `` and an unbound method object or ``NULL `` and an
1196
+ arbitrary callable). All of them are popped and the return value is pushed.
1195
1197
1196
1198
.. versionadded :: 3.7
1197
1199
0 commit comments