summaryrefslogtreecommitdiffstats
path: root/Lib/heapq.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-03-13 02:09:15 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-03-13 02:09:15 (GMT)
commit736c0ab428e69b1be67bd91969477e5227613241 (patch)
tree59193c21fa061c593f7eb264f19bcd406239a63d /Lib/heapq.py
parentc5a2eb949c5c19ed6d4dcada55ac970b5cc6c123 (diff)
downloadcpython-736c0ab428e69b1be67bd91969477e5227613241.zip
cpython-736c0ab428e69b1be67bd91969477e5227613241.tar.gz
cpython-736c0ab428e69b1be67bd91969477e5227613241.tar.bz2
Move itertools izip() code to builtins as zip(). Complete the renaming.
Diffstat (limited to 'Lib/heapq.py')
-rw-r--r--Lib/heapq.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/heapq.py b/Lib/heapq.py
index 48697f6..47d246e 100644
--- a/Lib/heapq.py
+++ b/Lib/heapq.py
@@ -129,7 +129,7 @@ From all times, sorting has always been a Great Art! :-)
__all__ = ['heappush', 'heappop', 'heapify', 'heapreplace', 'merge',
'nlargest', 'nsmallest']
-from itertools import islice, repeat, count, izip, tee
+from itertools import islice, repeat, count, tee
from operator import itemgetter, neg
import bisect
@@ -352,7 +352,7 @@ def nsmallest(n, iterable, key=None):
"""
in1, in2 = tee(iterable)
keys = in1 if key is None else map(key, in1)
- it = izip(keys, count(), in2) # decorate
+ it = zip(keys, count(), in2) # decorate
result = _nsmallest(n, it)
return list(map(itemgetter(2), result)) # undecorate
@@ -364,7 +364,7 @@ def nlargest(n, iterable, key=None):
"""
in1, in2 = tee(iterable)
keys = in1 if key is None else map(key, in1)
- it = izip(keys, map(neg, count()), in2) # decorate
+ it = zip(keys, map(neg, count()), in2) # decorate
result = _nlargest(n, it)
return list(map(itemgetter(2), result)) # undecorate