-
-
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 | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -1122,7 +1122,7 @@ iterations of the loop. | |||||||
| This bytecode distinguishes two cases: if ``STACK[-1]`` has a method with the | ||||||||
| correct name, the bytecode pushes the unbound method and ``STACK[-1]``. | ||||||||
| ``STACK[-1]`` will be used as the first argument (``self``) by :opcode:`CALL` | ||||||||
| when calling the unbound method. Otherwise, ``NULL`` and the object returned by | ||||||||
| or :opcode:`CALL_KW` when calling the unbound method. Otherwise, ``NULL`` and the object returned by | ||||||||
| the attribute lookup are pushed. | ||||||||
|
|
||||||||
| .. versionchanged:: 3.12 | ||||||||
|
|
@@ -1393,13 +1393,6 @@ iterations of the loop. | |||||||
| 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``) | ||||||||
|
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 | ||||||||
|
|
@@ -1413,22 +1406,17 @@ iterations of the loop. | |||||||
|
|
||||||||
| .. versionadded:: 3.11 | ||||||||
|
|
||||||||
| .. versionchanged:: 3.13 | ||||||||
| The callable now always appears at the same position on the stack. | ||||||||
|
|
||||||||
| .. 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 one or more named arguments. | ||||||||
| On the stack are (in ascending order): | ||||||||
|
|
||||||||
| * NULL | ||||||||
| * The callable | ||||||||
| * The positional arguments | ||||||||
| * The named arguments | ||||||||
|
|
||||||||
| or: | ||||||||
| including one or more named arguments. On the stack are (in ascending order): | ||||||||
|
|
||||||||
| * The callable | ||||||||
| * ``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
|
||||||||
|
|
@@ -1439,9 +1427,9 @@ iterations of the loop. | |||||||
| ``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, 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. | ||||||||
| ``CALL_KW`` 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.13 | ||||||||
|
|
||||||||
|
|
||||||||
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.
Break long line