diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -756,8 +756,15 @@ Pushes a new function object on the stack. TOS is the :term:`qualified name` of the function; TOS1 is the code associated with - the function. The function object is defined to have *argc* default parameters, - which are found below TOS1. + the function. The low byte of *argc* indicates the number of default positional + arguments, the high byte the number of default keyword-only arguments. If the + function has annotations, the value of the two additional bytes (provided with + the ``EXTENDED_ARG`` opcode) equals the number of annotations + 1. In this case + there is a tuple below TOS1, containing the names of the arguments which has + annotations. Below this tuple are the values of the annotations, in the same + order as the names in the tuple. Below these are the default values for the + positional arguments; below them are the names and default values for the + keyword-only arguments (for each pair the argument name is below the value). .. opcode:: MAKE_CLOSURE (argc) @@ -765,8 +772,8 @@ Creates a new function object, sets its *__closure__* slot, and pushes it on the stack. TOS is the :term:`qualified name` of the function, TOS1 is the code associated with the function, and TOS2 is the tuple containing cells for - the closure's free variables. The function also has *argc* default parameters, - which are found below the cells. + the closure's free variables. *argc* is interpreted as in ``MAKE_FUNCTION``; + the annotations and defaults are also in the same order below TOS2. .. opcode:: BUILD_SLICE (argc)