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

Functional Programming HOWTO: Dictionary ordering isn't "essentially random" #78264

Closed
Stigjb mannequin opened this issue Jul 10, 2018 · 6 comments
Closed

Functional Programming HOWTO: Dictionary ordering isn't "essentially random" #78264

Stigjb mannequin opened this issue Jul 10, 2018 · 6 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes docs Documentation in the Doc dir

Comments

@Stigjb
Copy link
Mannequin

Stigjb mannequin commented Jul 10, 2018

BPO 34083
Nosy @rhettinger, @methane, @miss-islington, @Stigjb
PRs
  • bpo-34083: Update dict order in Functional HOWTO #8230
  • [3.7] bpo-34083: Update dict order in Functional HOWTO (GH-8230) #8246
  • 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 2018-07-11.09:59:37.147>
    created_at = <Date 2018-07-10.10:17:05.224>
    labels = ['3.7', '3.8', 'docs']
    title = 'Functional Programming HOWTO: Dictionary ordering isn\'t "essentially random"'
    updated_at = <Date 2018-07-11.11:21:54.613>
    user = 'https://github.com/Stigjb'

    bugs.python.org fields:

    activity = <Date 2018-07-11.11:21:54.613>
    actor = 'miss-islington'
    assignee = 'rhettinger'
    closed = True
    closed_date = <Date 2018-07-11.09:59:37.147>
    closer = 'methane'
    components = ['Documentation']
    creation = <Date 2018-07-10.10:17:05.224>
    creator = 'Stig Johan Berggren'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34083
    keywords = ['patch']
    message_count = 6.0
    messages = ['321375', '321386', '321389', '321427', '321428', '321445']
    nosy_count = 5.0
    nosy_names = ['rhettinger', 'methane', 'docs@python', 'miss-islington', 'Stig Johan Berggren']
    pr_nums = ['8230', '8246']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue34083'
    versions = ['Python 3.7', 'Python 3.8']

    @Stigjb
    Copy link
    Mannequin Author

    Stigjb mannequin commented Jul 10, 2018

    The section about iterators in the Functional Programming HOWTO (https://docs.python.org/3/howto/functional.html#data-types-that-support-iterators) states the following about looping over dictionary keys:

    "Note that the order is essentially random, because it’s based on the hash ordering of the objects in the dictionary."

    Starting with 3.7, dictionary order is guaranteed to be the same as insertion order.

    @Stigjb Stigjb mannequin assigned docspython Jul 10, 2018
    @Stigjb Stigjb mannequin added 3.7 (EOL) end of life docs Documentation in the Doc dir labels Jul 10, 2018
    @rhettinger
    Copy link
    Contributor

    Thanks for noticing this. Do you want to contribute a patch or would you like me to just fix it up?

    @rhettinger rhettinger assigned rhettinger and unassigned docspython Jul 10, 2018
    @Stigjb
    Copy link
    Mannequin Author

    Stigjb mannequin commented Jul 10, 2018

    I'll try to patch it myself.

    @Stigjb Stigjb mannequin added the 3.8 only security fixes label Jul 11, 2018
    @methane
    Copy link
    Member

    methane commented Jul 11, 2018

    New changeset 5e5bbbe by INADA Naoki (Stig Johan Berggren) in branch 'master':
    bpo-34083: Update dict order in Functional HOWTO (GH-8230)
    5e5bbbe

    @methane
    Copy link
    Member

    methane commented Jul 11, 2018

    Thanks, Stig.
    And I'm sorry about I missed Raymond assigned himself.

    @methane methane closed this as completed Jul 11, 2018
    @miss-islington
    Copy link
    Contributor

    New changeset 151820e by Miss Islington (bot) in branch '3.7':
    bpo-34083: Update dict order in Functional HOWTO (GH-8230)
    151820e

    @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 docs Documentation in the Doc dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants