Issue 34083: Functional Programming HOWTO: Dictionary ordering isn't "essentially random"
Created on 2018-07-10 10:17 by Stig Johan Berggren, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 8230 | merged | Stig Johan Berggren, 2018-07-10 19:51 | |
| PR 8246 | merged | miss-islington, 2018-07-11 09:54 | |
| Messages (6) | |||
|---|---|---|---|
| msg321375 - (view) | Author: Stig Johan Berggren (Stig Johan Berggren) * | Date: 2018-07-10 10:17 | |
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. |
|||
| msg321386 - (view) | Author: Raymond Hettinger (rhettinger) * ![]() |
Date: 2018-07-10 13:21 | |
Thanks for noticing this. Do you want to contribute a patch or would you like me to just fix it up? |
|||
| msg321389 - (view) | Author: Stig Johan Berggren (Stig Johan Berggren) * | Date: 2018-07-10 16:04 | |
I'll try to patch it myself. |
|||
| msg321427 - (view) | Author: Inada Naoki (methane) * ![]() |
Date: 2018-07-11 09:53 | |
New changeset 5e5bbbec467a1569c914a048a94e7597528f92cf by INADA Naoki (Stig Johan Berggren) in branch 'master': bpo-34083: Update dict order in Functional HOWTO (GH-8230) https://github.com/python/cpython/commit/5e5bbbec467a1569c914a048a94e7597528f92cf |
|||
| msg321428 - (view) | Author: Inada Naoki (methane) * ![]() |
Date: 2018-07-11 09:59 | |
Thanks, Stig. And I'm sorry about I missed Raymond assigned himself. |
|||
| msg321445 - (view) | Author: miss-islington (miss-islington) | Date: 2018-07-11 11:21 | |
New changeset 151820e7a0ebe50b3d4fa64e22623c5470f1c56f by Miss Islington (bot) in branch '3.7': bpo-34083: Update dict order in Functional HOWTO (GH-8230) https://github.com/python/cpython/commit/151820e7a0ebe50b3d4fa64e22623c5470f1c56f |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:02 | admin | set | github: 78264 |
| 2018-07-11 11:21:54 | miss-islington | set | nosy:
+ miss-islington messages: + msg321445 |
| 2018-07-11 09:59:37 | methane | set | status: open -> closed resolution: fixed messages: + msg321428 stage: patch review -> resolved |
| 2018-07-11 09:54:19 | miss-islington | set | pull_requests: + pull_request7777 |
| 2018-07-11 09:53:09 | methane | set | nosy:
+ methane messages: + msg321427 |
| 2018-07-11 06:34:33 | Stig Johan Berggren | set | versions: + Python 3.8 |
| 2018-07-10 19:51:38 | Stig Johan Berggren | set | keywords:
+ patch stage: patch review pull_requests: + pull_request7768 |
| 2018-07-10 16:04:50 | Stig Johan Berggren | set | messages: + msg321389 |
| 2018-07-10 13:21:04 | rhettinger | set | assignee: docs@python -> rhettinger messages:
+ msg321386 |
| 2018-07-10 10:17:05 | Stig Johan Berggren | create | |
