Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
38eb8cd
bpo-39879: Update docs dict preserve insertion order
Mar 15, 2020
fb8e1ca
Fixed a typo
Mar 15, 2020
82f0250
Replaced tabs by spaces
Mar 15, 2020
9f34bb1
Added contributor name to Misc/ACKS
Mar 16, 2020
ca3eab0
📜🤖 Added by blurb_it.
blurb-it[bot] Mar 16, 2020
07808ec
Applying requested changes
Mar 18, 2020
b9a536e
Merge branch 'docs-dict-ordered' of github.com:AkechiShiro/cpython in…
Mar 18, 2020
d9458c3
Converting tabs to space
Mar 18, 2020
659094d
Fix trailing whitespace/convert tabs to space
Mar 18, 2020
b4b48d8
update language reference to specify that dict is insertion-ordered.
furkanonder Mar 18, 2020
8a1cfc5
Merge pull request #1 from furkanonder/docs-dict-ordered
AkechiShiro Mar 18, 2020
4e893c6
Revert "Docs dict ordered"
AkechiShiro Mar 18, 2020
f8a6397
Merge pull request #2 from AkechiShiro/revert-1-docs-dict-ordered
AkechiShiro Mar 18, 2020
ff04f7e
Revert "Revert "Docs dict ordered""
AkechiShiro Mar 18, 2020
2e31dda
Merge pull request #3 from AkechiShiro/revert-2-revert-1-docs-dict-or…
AkechiShiro Mar 18, 2020
baf48b0
Delete trailling whitespace
Mar 18, 2020
08fd18f
fix more trailling whitespace
AkechiShiro Mar 18, 2020
3c6b644
Requested changes fixes:versionchanged note moved at end of section
AkechiShiro Mar 18, 2020
f00776d
Update Misc/NEWS.d/next/Documentation/2020-03-16-18-12-02.bpo-39879.C…
AkechiShiro Mar 18, 2020
8ab1420
Removed unecessary words
AkechiShiro Mar 18, 2020
82dfca8
Merge branch 'docs-dict-ordered' of github.com:AkechiShiro/cpython in…
AkechiShiro Mar 18, 2020
df32abb
Clarify and precise note
AkechiShiro Mar 19, 2020
c757a5e
Fix typo
AkechiShiro Mar 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,11 @@ Mappings
equal (e.g., ``1`` and ``1.0``) then they can be used interchangeably to index
the same dictionary entry.

Dictionaries preserve insertion order, meaning that keys will be produced
in the same order they were added sequentially over the dictionary.
Replacing an existing key does not change the order, however removing a key
and re-inserting it will add it to the end instead of keeping its old place.

Comment thread
AkechiShiro marked this conversation as resolved.
Dictionaries are mutable; they can be created by the ``{...}`` notation (see
section :ref:`dict`).

Expand All @@ -436,6 +441,11 @@ Mappings
additional examples of mapping types, as does the :mod:`collections`
module.

.. versionchanged:: 3.7
Dictionaries did not preserve insertion order in versions of Python before 3.6.
In CPython 3.6, insertion order was preserved, but it was considered
an implementation detail at that time rather than a language guarantee.

Callable types
.. index::
object: callable
Expand Down
2 changes: 2 additions & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Ray Allen
Billy G. Allie
Jamiel Almeida
Kevin Altis
Samy Lahfa
Skyler Leigh Amador
Joe Amenta
Rose Ames
Expand Down Expand Up @@ -1235,6 +1236,7 @@ Jeffrey Ollie
Adam Olsen
Bryan Olson
Grant Olson
Furkan Onder
Koray Oner
Piet van Oostrum
Tomas Oppelstrup
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Updated :ref:`datamodel` docs to include :func:`dict` insertion order preservation.
Patch by Furkan Onder and Samy Lahfa.