@@ -1120,22 +1120,24 @@ All of the following opcodes use their arguments.
1120
1120
1121
1121
.. opcode :: LOAD_METHOD (namei)
1122
1122
1123
- Loads a method named ``co_names[namei] `` from TOS object. TOS is popped and
1124
- method and TOS are pushed when interpreter can call unbound method directly.
1125
- TOS will be used as the first argument (``self ``) by :opcode: `CALL_METHOD `.
1126
- Otherwise, ``NULL `` and method is pushed (method is bound method or
1127
- something else).
1123
+ Loads a method named ``co_names[namei] `` from the TOS object. TOS is popped.
1124
+ This bytecode distinguishes two cases: if TOS has a method with the correct
1125
+ name, the bytecode pushes the unbound method and TOS. TOS will be used as
1126
+ the first argument (``self ``) by :opcode: `CALL_METHOD ` when calling the
1127
+ unbound method. Otherwise, ``NULL `` and the object return by the attribute
1128
+ lookup are pushed.
1128
1129
1129
1130
.. versionadded :: 3.7
1130
1131
1131
1132
1132
1133
.. opcode :: CALL_METHOD (argc)
1133
1134
1134
- Calls a method. *argc * is number of positional arguments.
1135
+ Calls a method. *argc * is the number of positional arguments.
1135
1136
Keyword arguments are not supported. This opcode is designed to be used
1136
1137
with :opcode: `LOAD_METHOD `. Positional arguments are on top of the stack.
1137
- Below them, two items described in :opcode: `LOAD_METHOD ` on the stack.
1138
- All of them are popped and return value is pushed.
1138
+ Below them, the two items described in :opcode: `LOAD_METHOD ` are on the
1139
+ stack (either ``self `` and an unbound method object or ``NULL `` and an
1140
+ arbitrary callable). All of them are popped and the return value is pushed.
1139
1141
1140
1142
.. versionadded :: 3.7
1141
1143
0 commit comments