summaryrefslogtreecommitdiff
path: root/Lib/heapq.py
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-05-01 02:09:37 +0200
committerÉric Araujo <merwok@netwok.org>2011-05-01 02:09:37 +0200
commita27c8e37465b4a452e2b64af26062e133e968f42 (patch)
tree07e6cd40e8a30721bc6f80686b35daf7ff1369a6 /Lib/heapq.py
parentd6dcf8263ab7ffcbcd9a53234de60457c2c4c0d6 (diff)
parentb22e17b2d617bef2fc00f5de29f5a4196f97a51c (diff)
downloadcpython-git-a27c8e37465b4a452e2b64af26062e133e968f42.tar.gz
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 74f7310a2c..fcaca13442 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):