@@ -1804,39 +1804,24 @@ types should support too):
18041804
18051805.. method :: dict.items()
18061806
1807- Return a copy of the dictionary's list of ``(key, value) `` pairs.
1807+ Return an iterator over the dictionary's ``(key, value) `` pairs.
18081808
18091809 .. note ::
18101810
18111811 Keys and values are listed in an arbitrary order which is non-random, varies
18121812 across Python implementations, and depends on the dictionary's history of
1813- insertions and deletions. If :meth: `items `, :meth: `keys `, :meth: ` values `,
1814- :meth: `iteritems `, :meth: ` iterkeys `, and :meth: ` itervalues ` are called with no
1813+ insertions and deletions. If :meth: `items `, :meth: `keys `, and
1814+ :meth: `values ` are called with no
18151815 intervening modifications to the dictionary, the lists will directly correspond.
18161816 This allows the creation of ``(value, key) `` pairs using :func: `zip `: ``pairs =
18171817 zip(d.values(), d.keys()) ``. The same relationship holds for the
18181818 :meth: `iterkeys ` and :meth: `itervalues ` methods: ``pairs = zip(d.itervalues(),
18191819 d.iterkeys()) `` provides the same value for ``pairs ``. Another way to create the
1820- same list is ``pairs = [(v, k) for (k, v) in d.iteritems()] ``.
1821-
1822- .. method :: dict.iteritems()
1823-
1824- Return an iterator over the dictionary's ``(key, value) `` pairs.
1825- See the note for :meth: `dict.items `.
1826-
1827- .. method :: dict.iterkeys()
1828-
1829- Return an iterator over the dictionary's keys. See the note for
1830- :meth: `dict.items `.
1831-
1832- .. method :: dict.itervalues()
1833-
1834- Return an iterator over the dictionary's values. See the note for
1835- :meth: `dict.items `.
1820+ same list is ``pairs = [(v, k) for (k, v) in d.items()] ``.
18361821
18371822.. method :: dict.keys()
18381823
1839- Return a copy of the dictionary's list of keys. See the note for
1824+ Return an iterator over the dictionary's keys. See the note for
18401825 :meth: `dict.items `.
18411826
18421827.. method :: dict.pop(key[, default])
@@ -1855,13 +1840,13 @@ types should support too):
18551840
18561841.. method :: dict.setdefault(key[, default])
18571842
1858- If *key * is in the dictionary, return its value. If not, insert *key * with a
1859- value of *default * and return *default *. *default * defaults to ``None ``.
1843+ If *key * is in the dictionary, return its value. If not, insert *key * with
1844+ a value of *default * and return *default *. *default * defaults to ``None ``.
18601845
18611846.. method :: dict.update([other])
18621847
1863- Update the dictionary with the key/value pairs from *other *, overwriting existing
1864- keys. Return ``None ``.
1848+ Update the dictionary with the key/value pairs from *other *, overwriting
1849+ existing keys. Return ``None ``.
18651850
18661851 :func: `update ` accepts either another dictionary object or an iterable of
18671852 key/value pairs (as a tuple or other iterable of length two). If keyword
@@ -1870,8 +1855,8 @@ types should support too):
18701855
18711856.. method :: dict.values()
18721857
1873- Return a copy of the dictionary's list of values. See the note for
1874- :meth: `mapping .items `.
1858+ Return an iterator over the dictionary's values. See the note for
1859+ :meth: `dict .items `.
18751860
18761861
18771862.. _bltin-file-objects :
0 commit comments