mirror of https://github.com/python/cpython.git
gh-121367: [doc] BUILD_TUPLE arg can be 0 (#122663)
This commit is contained in:
parent
5207adf228
commit
1422500d02
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue