Skip to content
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

bpo-44530: Document the change in MAKE_FUNCTION behavior #93189

Merged
merged 3 commits into from
Jun 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
adaptive bytecode can be shown by passing ``adaptive=True``.


Example: Given the function :func:`myfunc`::

Check warning on line 46 in Doc/library/dis.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:func reference target not found: myfunc

def myfunc(alist):
return len(alist)

the following command can be used to display the disassembly of

Check warning on line 51 in Doc/library/dis.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:func reference target not found: myfunc
:func:`myfunc`:

.. doctest::
Expand Down Expand Up @@ -835,7 +835,7 @@

.. opcode:: LOAD_BUILD_CLASS

Pushes :func:`builtins.__build_class__` onto the stack. It is later called

Check warning on line 838 in Doc/library/dis.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:func reference target not found: builtins.__build_class__
to construct a class.


Expand Down Expand Up @@ -892,14 +892,14 @@

.. opcode:: STORE_NAME (namei)

Implements ``name = STACK.pop()``. *namei* is the index of *name* in the attribute

Check warning on line 895 in Doc/library/dis.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:attr reference target not found: co_names
:attr:`co_names` of the code object. The compiler tries to use
:opcode:`STORE_FAST` or :opcode:`STORE_GLOBAL` if possible.


.. opcode:: DELETE_NAME (namei)

Implements ``del name``, where *namei* is the index into :attr:`co_names`

Check warning on line 902 in Doc/library/dis.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:attr reference target not found: co_names
attribute of the code object.


Expand Down Expand Up @@ -938,7 +938,7 @@
value = STACK.pop()
obj.name = value

where *namei* is the index of name in :attr:`co_names`.

Check warning on line 941 in Doc/library/dis.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:attr reference target not found: co_names

.. opcode:: DELETE_ATTR (namei)

Expand All @@ -947,7 +947,7 @@
obj = STACK.pop()
del obj.name

where *namei* is the index of name into :attr:`co_names`.

Check warning on line 950 in Doc/library/dis.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:attr reference target not found: co_names


.. opcode:: STORE_GLOBAL (namei)
Expand Down Expand Up @@ -1431,12 +1431,15 @@
* ``0x02`` a dictionary of keyword-only parameters' default values
* ``0x04`` a tuple of strings containing parameters' annotations
* ``0x08`` a tuple containing cells for free variables, making a closure
* the code associated with the function (at ``STACK[-2]``)
* the :term:`qualified name` of the function (at ``STACK[-1]``)
* the code associated with the function (at ``STACK[-1]``)

.. versionchanged:: 3.10
Flag value ``0x04`` is a tuple of strings instead of dictionary

.. versionchanged:: 3.11
Qualified name at ``STACK[-1]`` was removed.


.. opcode:: BUILD_SLICE (argc)

.. index:: pair: built-in function; slice
Expand Down