Skip to content

Commit 79a9ca0

Browse files
authored
gh-126970: Correct LOAD_GLOBAL stack order documentation (#159851)
1 parent 4be1d35 commit 79a9ca0

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎Doc/library/dis.rst‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,10 +1436,14 @@ iterations of the loop.
14361436
.. opcode:: LOAD_GLOBAL (namei)
14371437

14381438
Loads the global named ``co_names[namei>>1]`` onto the stack.
1439+
If the low bit of ``namei`` is set, a ``NULL`` is pushed onto the stack
1440+
after the global variable.
14391441

14401442
.. versionchanged:: 3.11
1441-
If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the
1442-
stack before the global variable.
1443+
The low bit of ``namei`` indicates whether a ``NULL`` is pushed.
1444+
1445+
.. versionchanged:: 3.13
1446+
The ``NULL`` is pushed after the global variable, rather than before it.
14431447

14441448
.. opcode:: LOAD_FAST (var_num)
14451449

0 commit comments

Comments
 (0)