[docs] Document bytecode changes in 3.6 (issue 28810)

storchaka+cpython at gmail.com storchaka+cpython at gmail.com
Wed Feb 22 04:04:36 EST 2017


Reviewers: levkivskyi,


http://bugs.python.org/review/28810/diff/19372/Doc/library/dis.rst
File Doc/library/dis.rst (right):

http://bugs.python.org/review/28810/diff/19372/Doc/library/dis.rst#newcode980
Doc/library/dis.rst:980: pushes the return value.
On 2017/02/22 09:56:13, levkivskyi wrote:
> I think it is not completely clear what happens with
> 
> f(*x, *y, **z, **w)
> 
> As I understand, there will be always at most one element on the stack
built
> with BUILD_MAP_UNPACK_WITH_CALL, and only one element built by
> BUILD_TUPLE_UNPACK_WITH_CALL. The latter two are not documented yet. I
think it
> would make sense to also document them, and mention them here.

You understand it correctly. There is separate issue26213 for
documenting bytecode changes in 3.5.



Please review this at http://bugs.python.org/review/28810/

Affected files:
  Doc/library/dis.rst


diff -r 5904d2ced3d8 Doc/library/dis.rst
--- a/Doc/library/dis.rst	Tue Dec 06 19:25:19 2016 +0200
+++ b/Doc/library/dis.rst	Wed Dec 07 01:28:00 2016 +0200
@@ -947,14 +947,39 @@ All of the following opcodes use their a
 
 .. opcode:: CALL_FUNCTION (argc)
 
-   Calls a function.  The low byte of *argc* indicates the number of positional
-   parameters, the high byte the number of keyword parameters. On the stack, the
-   opcode finds the keyword parameters first.  For each keyword argument, the
-   value is on top of the key.  Below the keyword parameters, the positional
-   parameters are on the stack, with the right-most parameter on top.  Below the
-   parameters, the function object to call is on the stack.  Pops all function
-   arguments, and the function itself off the stack, and pushes the return
-   value.
+   Calls a function.  *argc* indicates the number of positional arguments.
+   The positional arguments are on the stack, with the right-most argument
+   on top.  Below the arguments, the function object to call is on the stack.
+   Pops all function arguments, and the function itself off the stack, and
+   pushes the return value.
+
+   .. versionchanged:: 3.6
+
+
+.. opcode:: CALL_FUNCTION_KW (argc)
+
+   Calls a function.  *argc* indicates the number of arguments (positional
+   and keyword).  The top element on the stack contains a tuple of keyword
+   argument names.  Below the tuple, keyword arguments are on the stack, in
+   the order corresponding to the tuple.  Below the keyword arguments, the
+   positional arguments are on the stack, with the right-most parameter on
+   top.  Below the arguments, the function object to call is on the stack.
+   Pops all function arguments, and the function itself off the stack, and
+   pushes the return value.
+
+   .. versionchanged:: 3.6
+
+
+.. opcode:: CALL_FUNCTION_EX (flags)
+
+   Calls a function. The lowest bit of *flags* indicates whether the
+   var-keyword argument is placed at the top of the stack.  Below the
+   var-keyword argument, the var-positional argument is on the stack.
+   Below the arguments, the function object to call is on the stack.
+   Pops all function arguments, and the function itself off the stack, and
+   pushes the return value.
+
+   .. versionadded:: 3.6
 
 
 .. opcode:: MAKE_FUNCTION (argc)
@@ -987,28 +1012,6 @@ All of the following opcodes use their a
    two most-significant bytes.
 
 
-.. opcode:: CALL_FUNCTION_VAR (argc)
-
-   Calls a function. *argc* is interpreted as in :opcode:`CALL_FUNCTION`. The
-   top element on the stack contains the variable argument list, followed by
-   keyword and positional arguments.
-
-
-.. opcode:: CALL_FUNCTION_KW (argc)
-
-   Calls a function. *argc* is interpreted as in :opcode:`CALL_FUNCTION`. The
-   top element on the stack contains the keyword arguments dictionary, followed
-   by explicit keyword and positional arguments.
-
-
-.. opcode:: CALL_FUNCTION_VAR_KW (argc)
-
-   Calls a function. *argc* is interpreted as in :opcode:`CALL_FUNCTION`.  The
-   top element on the stack contains the keyword arguments dictionary, followed
-   by the variable-arguments tuple, followed by explicit keyword and positional
-   arguments.
-
-
 .. opcode:: FORMAT_VALUE (flags)
 
    Used for implementing formatted literal strings (f-strings).  Pops




More information about the docs mailing list