Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 396ecb9

Browse files
andresdelfinomethane
authored andcommitted
bpo-33799: Remove non-ordered dicts comments from FAQ
1 parent b1f6902 commit 396ecb9

2 files changed

Lines changed: 1 addition & 10 deletions

File tree

Doc/faq/design.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -495,11 +495,7 @@ on the key and a per-process seed; for example, "Python" could hash to
495495
to 1142331976. The hash code is then used to calculate a location in an
496496
internal array where the value will be stored. Assuming that you're storing
497497
keys that all have different hash values, this means that dictionaries take
498-
constant time -- O(1), in computer science notation -- to retrieve a key. It
499-
also means that no sorted order of the keys is maintained, and traversing the
500-
array as the ``.keys()`` and ``.items()`` do will output the dictionary's
501-
content in some arbitrary jumbled order that can change with every invocation of
502-
a program.
498+
constant time -- O(1), in computer science notation -- to retrieve a key.
503499

504500

505501
Why must dictionary keys be immutable?

Doc/faq/programming.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,11 +1315,6 @@ that final assignment still results in an error, because tuples are immutable.
13151315
Dictionaries
13161316
============
13171317

1318-
How can I get a dictionary to store and display its keys in a consistent order?
1319-
-------------------------------------------------------------------------------
1320-
1321-
Use :class:`collections.OrderedDict`.
1322-
13231318
I want to do a complicated sort: can you do a Schwartzian Transform in Python?
13241319
------------------------------------------------------------------------------
13251320

0 commit comments

Comments
 (0)