Skip to content

Commit 010d391

Browse files
[3.15] gh-126970: Correct LOAD_GLOBAL stack order documentation (GH-159851) (#160349)
(cherry picked from commit 79a9ca0) Co-authored-by: limadog9 <jakewallin42@gmail.com>
1 parent f7517b0 commit 010d391

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
@@ -1433,10 +1433,14 @@ iterations of the loop.
14331433
.. opcode:: LOAD_GLOBAL (namei)
14341434

14351435
Loads the global named ``co_names[namei>>1]`` onto the stack.
1436+
If the low bit of ``namei`` is set, a ``NULL`` is pushed onto the stack
1437+
after the global variable.
14361438

14371439
.. versionchanged:: 3.11
1438-
If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the
1439-
stack before the global variable.
1440+
The low bit of ``namei`` indicates whether a ``NULL`` is pushed.
1441+
1442+
.. versionchanged:: 3.13
1443+
The ``NULL`` is pushed after the global variable, rather than before it.
14401444

14411445
.. opcode:: LOAD_FAST (var_num)
14421446

0 commit comments

Comments
 (0)