]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
docs: use consistent .append() in dis.rst (#115434)
authorNed Batchelder <ned@nedbatchelder.com>
Thu, 15 Feb 2024 07:14:03 +0000 (02:14 -0500)
committerGitHub <noreply@github.com>
Thu, 15 Feb 2024 07:14:03 +0000 (02:14 -0500)
The STACK variable is described as like a Python list, so pushing to it should be done with .append() consistently throughout.

Doc/library/dis.rst

index e654760fb91c65098b4954b95fd333218605ce01..190e994a12cc713306744e61c54371c2b1de5da0 100644 (file)
@@ -1606,7 +1606,7 @@ iterations of the loop.
 
       value = STACK.pop()
       result = func(value)
-      STACK.push(result)
+      STACK.append(result)
 
    * ``oparg == 1``: call :func:`str` on *value*
    * ``oparg == 2``: call :func:`repr` on *value*
@@ -1623,7 +1623,7 @@ iterations of the loop.
 
       value = STACK.pop()
       result = value.__format__("")
-      STACK.push(result)
+      STACK.append(result)
 
    Used for implementing formatted literal strings (f-strings).
 
@@ -1636,7 +1636,7 @@ iterations of the loop.
       spec = STACK.pop()
       value = STACK.pop()
       result = value.__format__(spec)
-      STACK.push(result)
+      STACK.append(result)
 
    Used for implementing formatted literal strings (f-strings).
 
@@ -1783,7 +1783,7 @@ iterations of the loop.
       arg2 = STACK.pop()
       arg1 = STACK.pop()
       result = intrinsic2(arg1, arg2)
-      STACK.push(result)
+      STACK.append(result)
 
    The operand determines which intrinsic function is called: