diff options
author | Fred Drake <fdrake@acm.org> | 2007-09-04 17:33:11 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2007-09-04 17:33:11 (GMT) |
commit | 2e74878ef261489d8fd852fff0be4f0ecaf7e2f0 (patch) | |
tree | f9a40ab9eb8401f315852e9674926b92cd1abb5a /Doc/library/itertools.rst | |
parent | afe0cd194f866f78914096bc34e9285af7032b1f (diff) | |
download | cpython-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.rst | 5 |
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() |