Skip to content

GH-105848: Get rid of KW_NAMES (again) #108496

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

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 12 additions & 22 deletions Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ the following command can be used to display the disassembly of
<BLANKLINE>
3 2 LOAD_GLOBAL 1 (len + NULL)
12 LOAD_FAST 0 (alist)
14 CALL 1
22 RETURN_VALUE
14 PUSH_NULL
16 CALL 1
24 RETURN_VALUE

(The "2" is a line number).

Expand Down Expand Up @@ -138,6 +139,7 @@ Example:
RESUME
LOAD_GLOBAL
LOAD_FAST
PUSH_NULL
CALL
RETURN_VALUE

Expand Down Expand Up @@ -1391,21 +1393,14 @@ 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:
including the named arguments, if any.
On the stack are (in ascending order):

* NULL
* The callable
* The positional arguments
* The named arguments

or:

* The callable
* ``self``
* ``self`` (or ``NULL``)
* The remaining positional arguments
* The named arguments
* A tuple of keyword names (or ``NULL``)

``argc`` is the total of the positional and named arguments, excluding
``self`` when a ``NULL`` is not present.
Expand All @@ -1416,6 +1411,10 @@ iterations of the loop.

.. versionadded:: 3.11

.. versionchanged:: 3.13
Keyword names are now pushed to the stack instead of being indicated by
a preceding ``KW_NAMES`` instruction.


.. opcode:: CALL_FUNCTION_EX (flags)

Expand All @@ -1441,15 +1440,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]``.
Expand Down
67 changes: 32 additions & 35 deletions Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

121 changes: 60 additions & 61 deletions Include/opcode_ids.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading