]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-31982: Improve sequence of presentation in ChainMap docs (GH-11960) (GH-11961)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 20 Feb 2019 22:23:29 +0000 (14:23 -0800)
committerRaymond Hettinger <rhettinger@users.noreply.github.com>
Wed, 20 Feb 2019 22:23:29 +0000 (14:23 -0800)
https://bugs.python.org/issue31982
(cherry picked from commit 9b0c681e2d7e708a07e34d9c08e4424bdd4f5ebc)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Doc/library/collections.rst

index 016e56c4bd0b09802d85a877d3bdf6b0ccaf7637..7ea6601c1a446a33de76cb03870d0a7acacf93bc 100644 (file)
@@ -163,8 +163,8 @@ contexts::
         e.maps[-1]            # Root context -- like Python's globals()
         e.parents             # Enclosing context chain -- like Python's nonlocals
 
-        d['x']                # Get first key in the chain of contexts
         d['x'] = 1            # Set value in current context
+        d['x']                # Get first key in the chain of contexts
         del d['x']            # Delete from current context
         list(d)               # All nested values
         k in d                # Check all nested values