summaryrefslogtreecommitdiffstats
path: root/Doc/library/itertools.rst
diff options
context:
space:
mode:
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()