Skip to content

Commit c96ef1f

Browse files
committed
Closes #13026: fix documentation of MAKE_FUNCTION for 3.x.
1 parent 57f936e commit c96ef1f

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Doc/library/dis.rst

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -754,10 +754,17 @@ the more significant byte last.
754754

755755
.. opcode:: MAKE_FUNCTION (argc)
756756

757-
Pushes a new function object on the stack. TOS is the
758-
:term:`qualified name` of the function; TOS1 is the code associated with
759-
the function. The function object is defined to have *argc* default parameters,
760-
which are found below TOS1.
757+
Pushes a new function object on the stack. From bottom to top, the consumed
758+
stack must consist of
759+
760+
* ``argc & 0xFF`` default argument objects in positional order
761+
* ``(argc >> 8) & 0xFF`` pairs of name and default argument, with the name
762+
just below the object on the stack, for keyword-only parameters
763+
* ``(argc >> 16) & 0x7FFF`` parameter annotation objects
764+
* a tuple listing the parameter names for the annotations (only if there are
765+
ony annotation objects)
766+
* the code associated with the function (at TOS1)
767+
* the :term:`qualified name` of the function (at TOS)
761768

762769

763770
.. opcode:: MAKE_CLOSURE (argc)

0 commit comments

Comments
 (0)