Issue 34083: Functional Programming HOWTO: Dictionary ordering isn't "essentially random" (original) (raw)

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/78264

classification

Title: Functional Programming HOWTO: Dictionary ordering isn't "essentially random"
Type: Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: Stig Johan Berggren, docs@python, methane, miss-islington, rhettinger
Priority: normal Keywords: patch

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) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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-islingtonmessages: +
2018-07-11 09:59:37 methane set status: open -> closedresolution: fixedmessages: + stage: patch review -> resolved
2018-07-11 09:54:19 miss-islington set pull_requests: + <pull%5Frequest7777>
2018-07-11 09:53:09 methane set nosy: + methanemessages: +
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: + patchstage: patch reviewpull_requests: + <pull%5Frequest7768>
2018-07-10 16:04:50 Stig Johan Berggren set messages: +
2018-07-10 13:21:04 rhettinger set assignee: docs@python -> rhettingermessages: + nosy: + rhettinger
2018-07-10 10:17:05 Stig Johan Berggren create