From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 8 Jun 2018 18:43:14 +0000 (-0700) Subject: bpo-33799: Remove non-ordered dicts comments from FAQ (GH-7520) X-Git-Tag: v3.7.0rc1~38 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5c7f22c2a339f23f8a236540d0ebed955637095b;p=python bpo-33799: Remove non-ordered dicts comments from FAQ (GH-7520) (cherry picked from commit 396ecb9c3e7fb150eace7bfc733d5b9d0263d697) Co-authored-by: Andrés Delfino --- diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst index 2e56fbc2f4..5d8f3a56c0 100644 --- a/Doc/faq/design.rst +++ b/Doc/faq/design.rst @@ -495,11 +495,7 @@ on the key and a per-process seed; for example, "Python" could hash to to 1142331976. The hash code is then used to calculate a location in an internal array where the value will be stored. Assuming that you're storing keys that all have different hash values, this means that dictionaries take -constant time -- O(1), in computer science notation -- to retrieve a key. It -also means that no sorted order of the keys is maintained, and traversing the -array as the ``.keys()`` and ``.items()`` do will output the dictionary's -content in some arbitrary jumbled order that can change with every invocation of -a program. +constant time -- O(1), in computer science notation -- to retrieve a key. Why must dictionary keys be immutable? diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst index 1a2f582a31..d986ab642b 100644 --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -1315,11 +1315,6 @@ that final assignment still results in an error, because tuples are immutable. Dictionaries ============ -How can I get a dictionary to store and display its keys in a consistent order? -------------------------------------------------------------------------------- - -Use :class:`collections.OrderedDict`. - I want to do a complicated sort: can you do a Schwartzian Transform in Python? ------------------------------------------------------------------------------