mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
[3.12] gh-121367: [doc] BUILD_TUPLE arg can be 0 (GH-122663) (#122684)
gh-121367: [doc] BUILD_TUPLE arg can be 0 (GH-122663)
(cherry picked from commit 1422500d02)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
parent
4d6b7b74a3
commit
8f19be47b6
1 changed files with 8 additions and 4 deletions
|
|
@ -995,11 +995,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…
Add table
Add a link
Reference in a new issue