-
-
Notifications
You must be signed in to change notification settings - Fork 34.1k
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 12 commits
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
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 | ||||||||
|
|
@@ -1390,31 +1390,48 @@ iterations of the loop. | |||||||
|
|
||||||||
| .. opcode:: CALL (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: | ||||||||
| 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 | ||||||||
| * ``self`` (or ``NULL``) | ||||||||
|
||||||||
| * ``self`` (or ``NULL``) | |
| * ``self`` or ``NULL`` |
Outdated
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.
I think it's clearer to just say "excluding self":
| ``argc`` is the total of the positional arguments, excluding | |
| ``self`` when a ``NULL`` is not present. | |
| ``argc`` is the total of the positional arguments, excluding ``self``. |
Outdated
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.
| * ``self`` (or ``NULL``) | |
| * ``self`` or ``NULL`` |
Outdated
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.
(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.
Outdated
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.
| ``argc`` is the total of the positional and named arguments, excluding | |
| ``self`` when a ``NULL`` is not present. | |
| ``argc`` is the total of the positional and named arguments, excluding ``self``. |
Large diffs are not rendered by default.
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