Skip to content

Commit d3ed67d

Browse files
authored
bpo-33609: small wording fixes to dict ordering docs
A few wording improvements to dict ordering documentation.
1 parent e7adf2b commit d3ed67d

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
@@ -4248,9 +4248,8 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098:
42484248
value)`` pairs. Order comparisons ('<', '<=', '>=', '>') raise
42494249
:exc:`TypeError`.
42504250

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

42554254
>>> d = {"one": 1, "two": 2, "three": 3, "four": 4}
42564255
>>> d
@@ -4268,7 +4267,7 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098:
42684267
{'one': 42, 'three': 3, 'four': 4, 'two': None}
42694268

42704269
.. versionchanged:: 3.7
4271-
Dict order is guaranteed to be insertion order. This behavior was
4270+
Dictionary order is guaranteed to be insertion order. This behavior was
42724271
implementation detail of CPython from 3.6.
42734272

42744273
.. seealso::
@@ -4307,7 +4306,7 @@ support membership tests:
43074306
a :exc:`RuntimeError` or fail to iterate over all entries.
43084307

43094308
.. versionchanged:: 3.7
4310-
Dict order is guaranteed to be insertion order.
4309+
Dictionary order is guaranteed to be insertion order.
43114310

43124311
.. describe:: x in dictview
43134312

@@ -4721,3 +4720,4 @@ types, where they are relevant. Some of these are not reported by the
47214720
47224721
.. [5] To format only a tuple you should therefore provide a singleton tuple whose only
47234722
element is the tuple to be formatted.
4723+

0 commit comments

Comments
 (0)