-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
GH-105848: Replace KW_NAMES + CALL with LOAD_CONST + CALL_KW
#109300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
5e43544
b7820ee
0ad7112
72d22a4
9c8ccf6
4c247af
367e7db
b0e33b6
6e6a3b4
135a499
6cd0318
53917a5
21b7fef
79f93cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -1390,10 +1390,38 @@ iterations of the loop. | |||||||
|
|
||||||||
| .. opcode:: CALL (argc) | ||||||||
|
|
||||||||
| Calls a callable object with the number of arguments specified by ``argc``. | ||||||||
| On the stack are (in ascending order): | ||||||||
|
|
||||||||
| * NULL | ||||||||
| * The callable | ||||||||
| * The positional arguments | ||||||||
| * The named arguments | ||||||||
|
|
||||||||
| or: | ||||||||
|
|
||||||||
| * The callable | ||||||||
| * ``self`` (or ``NULL``) | ||||||||
| * The remaining positional arguments | ||||||||
|
|
||||||||
| ``argc`` is the total of the positional arguments, excluding | ||||||||
| ``self`` when a ``NULL`` is not present. | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's clearer to just say "excluding self":
Suggested change
|
||||||||
|
|
||||||||
| ``CALL`` pops all arguments and the callable object off the stack, | ||||||||
| calls the callable object with those arguments, and pushes the return value | ||||||||
| returned by the callable object. | ||||||||
|
|
||||||||
| .. versionadded:: 3.11 | ||||||||
|
|
||||||||
| .. versionchanged:: 3.13 | ||||||||
| Calls with keyword arguments are now handled by :opcode:`CALL_KW`. | ||||||||
|
|
||||||||
|
|
||||||||
| .. opcode:: CALL_KW (argc) | ||||||||
|
|
||||||||
| Calls a callable object with the number of arguments specified by ``argc``, | ||||||||
| including the named arguments specified by the preceding | ||||||||
| :opcode:`KW_NAMES`, if any. | ||||||||
| On the stack are (in ascending order), either: | ||||||||
| including one or more named arguments. | ||||||||
| On the stack are (in ascending order): | ||||||||
|
|
||||||||
| * NULL | ||||||||
| * The callable | ||||||||
|
|
@@ -1403,18 +1431,19 @@ iterations of the loop. | |||||||
| or: | ||||||||
|
|
||||||||
| * The callable | ||||||||
| * ``self`` | ||||||||
| * ``self`` (or ``NULL``) | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| * The remaining positional arguments | ||||||||
| * The named arguments | ||||||||
| * A :class:`tuple` of keyword argument names | ||||||||
|
|
||||||||
| ``argc`` is the total of the positional and named arguments, excluding | ||||||||
| ``self`` when a ``NULL`` is not present. | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Same thing about whether "not" should be removed.) Make explicit that if there are N positional and M keyword arguments, oparg is N+M, and len(tuple) must be == M.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
|
||||||||
| ``CALL`` pops all arguments and the callable object off the stack, | ||||||||
| ``CALL`` pops all arguments, the keyword names, and the callable object off the stack, | ||||||||
| calls the callable object with those arguments, and pushes the return value | ||||||||
| returned by the callable object. | ||||||||
|
|
||||||||
| .. versionadded:: 3.11 | ||||||||
| .. versionadded:: 3.13 | ||||||||
|
|
||||||||
|
|
||||||||
| .. opcode:: CALL_FUNCTION_EX (flags) | ||||||||
|
|
@@ -1441,15 +1470,6 @@ iterations of the loop. | |||||||
| .. versionadded:: 3.11 | ||||||||
|
|
||||||||
|
|
||||||||
| .. opcode:: KW_NAMES (consti) | ||||||||
|
|
||||||||
| Prefixes :opcode:`CALL`. | ||||||||
| Stores a reference to ``co_consts[consti]`` into an internal variable | ||||||||
| for use by :opcode:`CALL`. ``co_consts[consti]`` must be a tuple of strings. | ||||||||
|
|
||||||||
| .. versionadded:: 3.11 | ||||||||
|
|
||||||||
|
|
||||||||
| .. opcode:: MAKE_FUNCTION | ||||||||
|
|
||||||||
| Pushes a new function object on the stack built from the code object at ``STACK[1]``. | ||||||||
|
|
||||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.