Issue 31982: 8.3. collections — Container datatypes (original) (raw)

Issue31982

Created on 2017-11-08 16:10 by Sasha Kacanski, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11960 merged rhettinger,2019-02-20 21:42
PR 11961 merged miss-islington,2019-02-20 21:49
Messages (6)
msg305876 - (view) Author: Sasha Kacanski (Sasha Kacanski) Date: 2017-11-08 16:10
Hi, In ChainMap example c = ChainMap() # Create root context d = c.new_child() # Create nested child context e = c.new_child() # Child of c, independent from d e.maps[0] # Current context dictionary -- like Python's locals() 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'] - will raise key does not exist error so simple fix is to flip last two lines... I know, possibly anal but look love Python and would like to help new folks to not get confused if they play with example in cPython shell... --best
msg305903 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-11-08 20:41
I will flip the two because there is not downside. However, the table of wasn't intended to be a sequential example (that's why there is no data or display of result). Instead, it was just meant to be table of typing-this-does-that.
msg305905 - (view) Author: Sasha Kacanski (Sasha Kacanski) Date: 2017-11-08 20:50
Agree, and I know. On Nov 8, 2017 3:41 PM, "Raymond Hettinger" <report@bugs.python.org> wrote: > > Raymond Hettinger <raymond.hettinger@gmail.com> added the comment: > > I will flip the two because there is not downside. However, the table of > wasn't intended to be a sequential example (that's why there is no data or > display of result). Instead, it was just meant to be table of > typing-this-does-that. > > ---------- > assignee: docs@python -> rhettinger > nosy: +rhettinger > priority: normal -> low > > _______________________________________ > Python tracker <report@bugs.python.org> > <https://bugs.python.org/issue31982> > _______________________________________ >
msg334307 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019-01-24 17:10
This is a duplicate of issue 31075, which was closed as 'Not a bug'.
msg336152 - (view) Author: miss-islington (miss-islington) Date: 2019-02-20 21:49
New changeset 9b0c681e2d7e708a07e34d9c08e4424bdd4f5ebc by Miss Islington (bot) (Raymond Hettinger) in branch 'master': bpo-31982: Improve sequence of presentation in ChainMap docs (GH-11960) https://github.com/python/cpython/commit/9b0c681e2d7e708a07e34d9c08e4424bdd4f5ebc
msg336153 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-02-20 22:23
New changeset 14baf06febb9194dd76f694ec359ce94708ed861 by Raymond Hettinger (Miss Islington (bot)) in branch '3.7': bpo-31982: Improve sequence of presentation in ChainMap docs (GH-11960) (GH-11961) https://github.com/python/cpython/commit/14baf06febb9194dd76f694ec359ce94708ed861
History
Date User Action Args
2022-04-11 14:58:54 admin set github: 76163
2019-02-20 22:25:43 rhettinger set status: open -> closedresolution: fixedstage: patch review -> resolved
2019-02-20 22:23:38 rhettinger set messages: +
2019-02-20 21:49:59 miss-islington set pull_requests: + <pull%5Frequest11987>
2019-02-20 21:49:26 miss-islington set nosy: + miss-islingtonmessages: +
2019-02-20 21:42:18 rhettinger set keywords: + patchstage: patch reviewpull_requests: + <pull%5Frequest11986>
2019-01-24 17:10:00 cheryl.sabella set nosy: + cheryl.sabellamessages: +
2017-11-08 20:50:58 Sasha Kacanski set messages: +
2017-11-08 20:41:45 rhettinger set priority: normal -> lownosy: + rhettingermessages: + assignee: docs@python -> rhettinger
2017-11-08 16:10:51 Sasha Kacanski create