This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients methane, ned.deily, rhettinger, shangdahao, steven.daprano, xiang.zhang
Date 2018-04-04.04:41:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1522816889.23.0.467229070634.issue32337@psf.upfronthosting.co.za>
In-reply-to
Content
I started to add this comment to #33218 but Raymond closed that ticket while I was editing it.

In 3.6, dicts preserving insertion order remains an implementation detail that cannot be relied on. It only becomes a guarantee in 3.7.

Even in 3.7, I think that it remains best to think of dicts as fundamentally unordered. Dicts might preserve insertion order, but there's no interface for extracting the n-th item, or re-ordering the keys into some alternative order, and for the purposes of equality comparisons, the order is ignored.

I propose changing the description from "It is best to think of a dictionary as an unordered set of key: value pairs" to something like:


    Dicts are an otherwise unordered set of key:value pairs
    that remember the order keys were inserted.


and references to "arbitrary order" should be replaced by "insertion order". But by no means should we suggest that dicts are fundamentally orderable (sortable).
History
Date User Action Args
2018-04-04 04:41:29steven.dapranosetrecipients: + steven.daprano, rhettinger, ned.deily, methane, xiang.zhang, shangdahao
2018-04-04 04:41:29steven.dapranosetmessageid: <1522816889.23.0.467229070634.issue32337@psf.upfronthosting.co.za>
2018-04-04 04:41:29steven.dapranolinkissue32337 messages
2018-04-04 04:41:28steven.dapranocreate