value)`` pairs. Order comparisons ('<', '<=', '>=', '>') raise
:exc:`TypeError`.
- Dict preserves insertion order. Note that updating key doesn't affects the
- order. On the other hand, keys added after deletion are inserted to the
- last. ::
+ Dictionaries preserve insertion order. Note that updating a key does not
+ affect the order. Keys added after deletion are inserted at the end. ::
>>> d = {"one": 1, "two": 2, "three": 3, "four": 4}
>>> d
{'one': 42, 'three': 3, 'four': 4, 'two': None}
.. versionchanged:: 3.7
- Dict order is guaranteed to be insertion order. This behavior was
+ Dictionary order is guaranteed to be insertion order. This behavior was
implementation detail of CPython from 3.6.
.. seealso::
a :exc:`RuntimeError` or fail to iterate over all entries.
.. versionchanged:: 3.7
- Dict order is guaranteed to be insertion order.
+ Dictionary order is guaranteed to be insertion order.
.. describe:: x in dictview
.. [5] To format only a tuple you should therefore provide a singleton tuple whose only
element is the tuple to be formatted.
+