Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8.3. collections — Container datatypes #76163

Closed
catchmonster mannequin opened this issue Nov 8, 2017 · 6 comments
Closed

8.3. collections — Container datatypes #76163

catchmonster mannequin opened this issue Nov 8, 2017 · 6 comments
Assignees
Labels
docs Documentation in the Doc dir

Comments

@catchmonster
Copy link
Mannequin

catchmonster mannequin commented Nov 8, 2017

BPO 31982
Nosy @rhettinger, @csabella, @catchmonster, @miss-islington
PRs
  • bpo-31982: Improve sequence of presentation in ChainMap docs #11960
  • [3.7] bpo-31982: Improve sequence of presentation in ChainMap docs (GH-11960) #11961
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/rhettinger'
    closed_at = <Date 2019-02-20.22:25:43.592>
    created_at = <Date 2017-11-08.16:10:51.930>
    labels = ['docs']
    title = '8.3. collections \xe2\x80\x94 Container datatypes'
    updated_at = <Date 2019-02-20.22:25:43.592>
    user = 'https://github.com/catchmonster'

    bugs.python.org fields:

    activity = <Date 2019-02-20.22:25:43.592>
    actor = 'rhettinger'
    assignee = 'rhettinger'
    closed = True
    closed_date = <Date 2019-02-20.22:25:43.592>
    closer = 'rhettinger'
    components = ['Documentation']
    creation = <Date 2017-11-08.16:10:51.930>
    creator = 'Sasha Kacanski'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31982
    keywords = ['patch']
    message_count = 6.0
    messages = ['305876', '305903', '305905', '334307', '336152', '336153']
    nosy_count = 5.0
    nosy_names = ['rhettinger', 'docs@python', 'cheryl.sabella', 'Sasha Kacanski', 'miss-islington']
    pr_nums = ['11960', '11961']
    priority = 'low'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue31982'
    versions = ['Python 3.6']

    @catchmonster
    Copy link
    Mannequin Author

    catchmonster mannequin commented Nov 8, 2017

    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

    @catchmonster catchmonster mannequin assigned docspython Nov 8, 2017
    @catchmonster catchmonster mannequin added the docs Documentation in the Doc dir label Nov 8, 2017
    @rhettinger
    Copy link
    Contributor

    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.

    @rhettinger rhettinger assigned rhettinger and unassigned docspython Nov 8, 2017
    @catchmonster
    Copy link
    Mannequin Author

    catchmonster mannequin commented Nov 8, 2017

    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\>


    @csabella
    Copy link
    Contributor

    This is a duplicate of bpo-31075, which was closed as 'Not a bug'.

    @miss-islington
    Copy link
    Contributor

    New changeset 9b0c681 by Miss Islington (bot) (Raymond Hettinger) in branch 'master':
    bpo-31982: Improve sequence of presentation in ChainMap docs (GH-11960)
    9b0c681

    @rhettinger
    Copy link
    Contributor

    New changeset 14baf06 by Raymond Hettinger (Miss Islington (bot)) in branch '3.7':
    bpo-31982: Improve sequence of presentation in ChainMap docs (GH-11960) (GH-11961)
    14baf06

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants