summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/library/dis.rst12
1 files changed, 8 insertions, 4 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
index 26b13c8..440ca23 100644
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -1081,11 +1081,15 @@ iterations of the loop.
.. opcode:: BUILD_TUPLE (count)
Creates a tuple consuming *count* items from the stack, and pushes the
- resulting tuple onto the stack.::
+ resulting tuple onto the stack::
- assert count > 0
- STACK, values = STACK[:-count], STACK[-count:]
- STACK.append(tuple(values))
+ if count == 0:
+ value = ()
+ else:
+ STACK = STACK[:-count]
+ value = tuple(STACK[-count:])
+
+ STACK.append(value)
.. opcode:: BUILD_LIST (count)