summaryrefslogtreecommitdiffstats
path: root/Lib/heapq.py
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-05-02 11:36:18 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-05-02 11:36:18 (GMT)
commitcfa8483051554b0e300b4b0c4a84c65bd2819cd3 (patch)
treebee40781a6ac3047269fe8ac195008de4ec181fb /Lib/heapq.py
parent941592aa19c3419a04a253c8897b672fe88cbae3 (diff)
parent2a53d33dc61e782c091ea8319ca0098ed2ff36a8 (diff)
downloadcpython-cfa8483051554b0e300b4b0c4a84c65bd2819cd3.zip
cpython-cfa8483051554b0e300b4b0c4a84c65bd2819cd3.tar.gz
cpython-cfa8483051554b0e300b4b0c4a84c65bd2819cd3.tar.bz2
Branch merge
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 74f7310..fcaca13 100644
--- a/Lib/heapq.py
+++ b/Lib/heapq.py
@@ -178,7 +178,7 @@ def heappushpop(heap, item):
return item
def heapify(x):
- """Transform list into a heap, in-place, in O(len(heap)) time."""
+ """Transform list into a heap, in-place, in O(len(x)) time."""
n = len(x)
# Transform bottom-up. The largest index there's any point to looking at
# is the largest with a child index in-range, so must have 2*i + 1 < n,
@@ -368,7 +368,7 @@ def nsmallest(n, iterable, key=None):
return [min(chain(head, it))]
return [min(chain(head, it), key=key)]
- # When n>=size, it's faster to use sort()
+ # When n>=size, it's faster to use sorted()
try:
size = len(iterable)
except (TypeError, AttributeError):
@@ -406,7 +406,7 @@ def nlargest(n, iterable, key=None):
return [max(chain(head, it))]
return [max(chain(head, it), key=key)]
- # When n>=size, it's faster to use sort()
+ # When n>=size, it's faster to use sorted()
try:
size = len(iterable)
except (TypeError, AttributeError):