]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix variable name in dis documentation example (GH-109343)
authorOleksandr Kravets <73752159+olekskrav@users.noreply.github.com>
Wed, 13 Sep 2023 05:07:56 +0000 (01:07 -0400)
committerGitHub <noreply@github.com>
Wed, 13 Sep 2023 05:07:56 +0000 (08:07 +0300)
BINARY_SUBSCR example erroneously uses two different names `key` and `index` to refer to the same variable. STORE_SUBSCR and DELETE_SUBSCR use only `key` in the same context. Changing `index` to `key` for consistency.

Doc/library/dis.rst

index 72e55cd81d42f6c8ba41150425d8737ac9c3c2e8..d087c7c1adc34db481f2f90ec7e5ef6ad76b9edb 100644 (file)
@@ -597,7 +597,7 @@ not have to be) the original ``STACK[-2]``.
 
       key = STACK.pop()
       container = STACK.pop()
-      STACK.append(container[index])
+      STACK.append(container[key])
 
 
 .. opcode:: STORE_SUBSCR