summaryrefslogtreecommitdiffstats
path: root/Doc/library/itertools.rst
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2007-09-04 17:33:11 (GMT)
committerFred Drake <fdrake@acm.org>2007-09-04 17:33:11 (GMT)
commit2e74878ef261489d8fd852fff0be4f0ecaf7e2f0 (patch)
treef9a40ab9eb8401f315852e9674926b92cd1abb5a /Doc/library/itertools.rst
parentafe0cd194f866f78914096bc34e9285af7032b1f (diff)
downloadcpython-2e74878ef261489d8fd852fff0be4f0ecaf7e2f0.zip
cpython-2e74878ef261489d8fd852fff0be4f0ecaf7e2f0.tar.gz
cpython-2e74878ef261489d8fd852fff0be4f0ecaf7e2f0.tar.bz2
remove/update many of the references to dict.iter*()
Diffstat (limited to 'Doc/library/itertools.rst')
-rw-r--r--Doc/library/itertools.rst5
1 files changed, 1 insertions, 4 deletions
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index d6e3291..97399f5 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -414,7 +414,7 @@ can be combined. ::
# Show a dictionary sorted and grouped by value
>>> from operator import itemgetter
>>> d = dict(a=1, b=2, c=1, d=2, e=1, f=2, g=3)
- >>> di = sorted(d.iteritems(), key=itemgetter(1))
+ >>> di = sorted(d.items(), key=itemgetter(1))
>>> for k, g in groupby(di, key=itemgetter(1)):
... print(k, map(itemgetter(0), g))
...
@@ -464,9 +464,6 @@ incur interpreter overhead. ::
"Return function(0), function(1), ..."
return imap(function, count())
- def iteritems(mapping):
- return izip(mapping.iterkeys(), mapping.itervalues())
-
def nth(iterable, n):
"Returns the nth item or raise StopIteration"
return islice(iterable, n, None).next()