Skip to content

Commit 9b0d4d0

Browse files
miss-islingtonnascheme
authored andcommitted
bpo-33609: small wording fixes to dict ordering docs (#7497)
A few wording improvements to dict ordering documentation. (cherry picked from commit d3ed67d) Co-authored-by: Neil Schemenauer <[email protected]>
1 parent ab5da50 commit 9b0d4d0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Doc/library/stdtypes.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4229,9 +4229,8 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098:
42294229
value)`` pairs. Order comparisons ('<', '<=', '>=', '>') raise
42304230
:exc:`TypeError`.
42314231

4232-
Dict preserves insertion order. Note that updating key doesn't affects the
4233-
order. On the other hand, keys added after deletion are inserted to the
4234-
last. ::
4232+
Dictionaries preserve insertion order. Note that updating a key does not
4233+
affect the order. Keys added after deletion are inserted at the end. ::
42354234

42364235
>>> d = {"one": 1, "two": 2, "three": 3, "four": 4}
42374236
>>> d
@@ -4249,7 +4248,7 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098:
42494248
{'one': 42, 'three': 3, 'four': 4, 'two': None}
42504249

42514250
.. versionchanged:: 3.7
4252-
Dict order is guaranteed to be insertion order. This behavior was
4251+
Dictionary order is guaranteed to be insertion order. This behavior was
42534252
implementation detail of CPython from 3.6.
42544253

42554254
.. seealso::
@@ -4288,7 +4287,7 @@ support membership tests:
42884287
a :exc:`RuntimeError` or fail to iterate over all entries.
42894288

42904289
.. versionchanged:: 3.7
4291-
Dict order is guaranteed to be insertion order.
4290+
Dictionary order is guaranteed to be insertion order.
42924291

42934292
.. describe:: x in dictview
42944293

@@ -4702,3 +4701,4 @@ types, where they are relevant. Some of these are not reported by the
47024701
47034702
.. [5] To format only a tuple you should therefore provide a singleton tuple whose only
47044703
element is the tuple to be formatted.
4704+

0 commit comments

Comments
 (0)