[Python-checkins] r74748 - python/branches/py3k/Doc/library/collections.rst

ezio.melotti python-checkins at python.org
Sat Sep 12 03:52:05 CEST 2009


Author: ezio.melotti
Date: Sat Sep 12 03:52:05 2009
New Revision: 74748
Log:
d.items() -> list(d.items()) in the examples
Modified:
 python/branches/py3k/Doc/library/collections.rst
Modified: python/branches/py3k/Doc/library/collections.rst
==============================================================================
--- python/branches/py3k/Doc/library/collections.rst	(original)
+++ python/branches/py3k/Doc/library/collections.rst	Sat Sep 12 03:52:05 2009
@@ -538,7 +538,7 @@
 >>> for k, v in s:
 ... d[k].append(v)
 ...
- >>> d.items()
+ >>> list(d.items())
 [('blue', [2, 4]), ('red', [1]), ('yellow', [1, 3])]
 
 When each key is encountered for the first time, it is not already in the
@@ -553,7 +553,7 @@
 >>> for k, v in s:
 ... d.setdefault(k, []).append(v)
 ...
- >>> d.items()
+ >>> list(d.items())
 [('blue', [2, 4]), ('red', [1]), ('yellow', [1, 3])]
 
 Setting the :attr:`default_factory` to :class:`int` makes the
@@ -565,7 +565,7 @@
 >>> for k in s:
 ... d[k] += 1
 ...
- >>> d.items()
+ >>> list(d.items())
 [('i', 4), ('p', 2), ('s', 4), ('m', 1)]
 
 When a letter is first encountered, it is missing from the mapping, so the
@@ -592,7 +592,7 @@
 >>> for k, v in s:
 ... d[k].add(v)
 ...
- >>> d.items()
+ >>> list(d.items())
 [('blue', set([2, 4])), ('red', set([1, 3]))]
 
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /