From 7139985b74781ef54f463076675acf758668788e Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Wed, 22 Feb 2017 15:11:01 +0100 Subject: [PATCH 1/2] Document BUILD_TUPLE_UNPACK_WITH_CALL bytecode added in 3.6 --- Doc/library/dis.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 694d5642fb0e21..3ff28fa8a6c405 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -785,6 +785,15 @@ All of the following opcodes use their arguments. .. versionadded:: 3.6 +.. opcode:: BUILD_TUPLE_UNPACK_WITH_CALL (count) + + This is similar to :opcode:`BUILD_TUPLE_UNPACK`, + but is used for ``f(*x, *y, *z)`` call syntax. The stack item at position + ``count + 1`` should be the corresponding callable ``f``. + + .. versionadded:: 3.6 + + .. opcode:: BUILD_STRING (count) Concatenates *count* strings from the stack and pushes the resulting string From fefdb9a873c0625a51e7f58f84a5c211d81f98f6 Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Fri, 3 Mar 2017 23:11:14 +0100 Subject: [PATCH 2/2] Update after PR 238 is merged --- Doc/library/dis.rst | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 09c59f2d7548db..0c27653e347064 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -790,15 +790,6 @@ All of the following opcodes use their arguments. .. versionadded:: 3.6 -.. opcode:: BUILD_TUPLE_UNPACK_WITH_CALL (count) - - This is similar to :opcode:`BUILD_TUPLE_UNPACK`, - but is used for ``f(*x, *y, *z)`` call syntax. The stack item at position - ``count + 1`` should be the corresponding callable ``f``. - - .. versionadded:: 3.6 - - .. opcode:: BUILD_STRING (count) Concatenates *count* strings from the stack and pushes the resulting string @@ -816,6 +807,15 @@ All of the following opcodes use their arguments. .. versionadded:: 3.5 +.. opcode:: BUILD_TUPLE_UNPACK_WITH_CALL (count) + + This is similar to :opcode:`BUILD_TUPLE_UNPACK`, + but is used for ``f(*x, *y, *z)`` call syntax. The stack item at position + ``count + 1`` should be the corresponding callable ``f``. + + .. versionadded:: 3.6 + + .. opcode:: BUILD_LIST_UNPACK (count) This is similar to :opcode:`BUILD_TUPLE_UNPACK`, but pushes a list @@ -843,14 +843,16 @@ All of the following opcodes use their arguments. .. versionadded:: 3.5 -.. opcode:: BUILD_MAP_UNPACK_WITH_CALL (oparg) +.. opcode:: BUILD_MAP_UNPACK_WITH_CALL (count) This is similar to :opcode:`BUILD_MAP_UNPACK`, - but is used for ``f(**x, **y, **z)`` call syntax. The lowest byte of - *oparg* is the count of mappings, the relative position of the - corresponding callable ``f`` is encoded in the second byte of *oparg*. + but is used for ``f(**x, **y, **z)`` call syntax. The stack item at + position ``count + 2`` should be the corresponding callable ``f``. .. versionadded:: 3.5 + .. versionchanged:: 3.6 + The position of the callable is determined by adding 2 to the opcode + argument instead of encoding it in the second byte of the argument. .. opcode:: LOAD_ATTR (namei)