From 705535cc8e853342f1680a39426e2600342e1b73 Mon Sep 17 00:00:00 2001 From: Jake Wallin Date: Tue, 20 Oct 2026 02:35:54 +0000 Subject: [PATCH] gh-126970: Correct LOAD_GLOBAL stack order documentation --- Doc/library/dis.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index e185d79b71c2a9..15c138ee938bf6 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1436,10 +1436,14 @@ iterations of the loop. .. opcode:: LOAD_GLOBAL (namei) Loads the global named ``co_names[namei>>1]`` onto the stack. + If the low bit of ``namei`` is set, a ``NULL`` is pushed onto the stack + after the global variable. .. versionchanged:: 3.11 - If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the - stack before the global variable. + The low bit of ``namei`` indicates whether a ``NULL`` is pushed. + + .. versionchanged:: 3.13 + The ``NULL`` is pushed after the global variable, rather than before it. .. opcode:: LOAD_FAST (var_num)