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

Update language reference to specify that dict is insertion-ordered. #84060

Closed
ericsnowcurrently opened this issue Mar 6, 2020 · 14 comments
Closed
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes docs Documentation in the Doc dir easy

Comments

@ericsnowcurrently
Copy link
Member

BPO 39879
Nosy @vstinner, @ericsnowcurrently, @zware, @Mariatta, @miss-islington, @furkanonder, @AkechiShiro
PRs
  • bpo-39879: Update docs dict preserve insertion order #19006
  • bpo-39879: update language reference to specify that dict is insertion-ordered. #19027
  • [3.8] bpo-39879: Update datamodel docs to include dict ordering (GH-19006) #19173
  • [3.7] bpo-39879: Update datamodel docs to include dict ordering (GH-19006) #19174
  • 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 = None
    closed_at = <Date 2020-03-26.15:01:56.496>
    created_at = <Date 2020-03-06.18:33:48.298>
    labels = ['easy', '3.7', '3.8', '3.9', 'docs']
    title = 'Update language reference to specify that dict is insertion-ordered.'
    updated_at = <Date 2020-03-26.15:19:26.333>
    user = 'https://github.com/ericsnowcurrently'

    bugs.python.org fields:

    activity = <Date 2020-03-26.15:19:26.333>
    actor = 'vstinner'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2020-03-26.15:01:56.496>
    closer = 'zach.ware'
    components = ['Documentation']
    creation = <Date 2020-03-06.18:33:48.298>
    creator = 'eric.snow'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39879
    keywords = ['patch', 'easy']
    message_count = 14.0
    messages = ['363533', '364204', '364206', '364229', '364303', '364484', '364494', '364502', '364520', '365080', '365081', '365082', '365083', '365085']
    nosy_count = 8.0
    nosy_names = ['vstinner', 'docs@python', 'eric.snow', 'zach.ware', 'Mariatta', 'miss-islington', 'furkanonder', 'AkechiShiro']
    pr_nums = ['19006', '19027', '19173', '19174']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue39879'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    @ericsnowcurrently
    Copy link
    Member Author

    As of 3.7 [1], dict is guaranteed to preserve insertion order:

    the insertion-order preservation nature of dict
    objects has been declared to be an official part
    of the Python language spec.

    However, at least one key part of the language reference [2] was not updated to reflect this: "3.2. The standard type hierarchy" > "Mappings" > "Dictionaries".

    Note that the library docs [3] *were* updated.

    [1] https://docs.python.org/3/whatsnew/3.7.html#summary-release-highlights
    [2] https://docs.python.org/3/reference/datamodel.html#index-30
    [3] https://docs.python.org/3/library/stdtypes.html#typesmapping

    @ericsnowcurrently ericsnowcurrently added 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes labels Mar 6, 2020
    @ericsnowcurrently ericsnowcurrently added docs Documentation in the Doc dir 3.7 (EOL) end of life easy 3.8 only security fixes 3.9 only security fixes labels Mar 6, 2020
    @ericsnowcurrently ericsnowcurrently added docs Documentation in the Doc dir easy labels Mar 6, 2020
    @AkechiShiro
    Copy link
    Mannequin

    AkechiShiro mannequin commented Mar 14, 2020

    Hi,

    I would like to take this issue as my first contribution to Python, I'm currently subscribed to the python-core-mentorship list.
    I do not know exactly how to submit a patch for an issue.

    Kind regards.

    @Mariatta
    Copy link
    Member

    Patch are submitted as pull request on our GitHub repo.
    Here's a write-up on how to do it
    https://devguide.python.org/pullrequest/#step-by-step-guide

    @AkechiShiro
    Copy link
    Mannequin

    AkechiShiro mannequin commented Mar 15, 2020

    Following the guide, I've send a patch with the fix, I'm waiting for a review. Once the patch will be reviewed and accepted. My patch will need to be backported from 3.9 to 3.7.

    @furkanonder
    Copy link
    Mannequin

    furkanonder mannequin commented Mar 16, 2020

    I sent pr. All tests passed successfully. If accepted, this will be my first contribution :)
    #19027

    @zware
    Copy link
    Member

    zware commented Mar 17, 2020

    Hi Furkan. Please note that Lahfa Samy had already submitted a PR for this issue after "claiming" it with a note here; proper "netiquette" suggests not jumping in with your own PR in such a situation.

    Fortuitously though, it looks like the both of you have actually implemented about half of the final change that we need here :). I'll be leaving review comments on both PRs; I recommend that the two of you work together to combine your PRs into a single PR with both of your (revised) changes.

    @AkechiShiro
    Copy link
    Mannequin

    AkechiShiro mannequin commented Mar 18, 2020

    Hi Furkan, would you mind to combine your revised PR with mine so that we can do as suggested by Zachary?

    @furkanonder
    Copy link
    Mannequin

    furkanonder mannequin commented Mar 18, 2020

    Hello Samy,
    I sent you pr from the docs-dict-ordered branch in your cpython repository. Now both of us have merged pr. I closed my own pr. You can also close your pr and send these changes again as bpo-39879.

    It's my pr,AkechiShiro#1

    @AkechiShiro
    Copy link
    Mannequin

    AkechiShiro mannequin commented Mar 18, 2020

    Thank you for your quick work, I have successfully merged your changes in the branch of the first PR, now awaiting review from Zachary.

    @zware
    Copy link
    Member

    zware commented Mar 26, 2020

    New changeset 59c644e by Lahfa Samy in branch 'master':
    bpo-39879: Update datamodel docs to include dict ordering (GH-19006)
    59c644e

    @miss-islington
    Copy link
    Contributor

    New changeset ea0eeb8 by Miss Islington (bot) in branch '3.7':
    bpo-39879: Update datamodel docs to include dict ordering (GH-19006)
    ea0eeb8

    @miss-islington
    Copy link
    Contributor

    New changeset 96686c7 by Miss Islington (bot) in branch '3.8':
    bpo-39879: Update datamodel docs to include dict ordering (GH-19006)
    96686c7

    @zware
    Copy link
    Member

    zware commented Mar 26, 2020

    Thanks for the patch!

    @zware zware closed this as completed Mar 26, 2020
    @zware zware closed this as completed Mar 26, 2020
    @vstinner
    Copy link
    Member

    What's New in Python 3.7 says:

    the insertion-order preservation nature of dict objects has been declared to be an official part of the Python language spec.

    Reference: https://mail.python.org/pipermail/python-dev/2017-December/151283.html

    I just wanted to add a reference for this change. I wanted to check if it is ok to modify the doc: yes, it is :-)

    @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
    3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes docs Documentation in the Doc dir easy
    Projects
    None yet
    Development

    No branches or pull requests

    5 participants