summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-04-15 21:34:31 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-04-15 21:34:31 (GMT)
commit4800d6470cb8bb8646963123f656a9670a52334e (patch)
tree5833cde061da898cf06374c325b2d07b1a1af74f
parente4f8d839a7de2d8da60aec9d5e0dd12440a7a715 (diff)
downloadcpython-4800d6470cb8bb8646963123f656a9670a52334e.zip
cpython-4800d6470cb8bb8646963123f656a9670a52334e.tar.gz
cpython-4800d6470cb8bb8646963123f656a9670a52334e.tar.bz2
Minor tweaks to a few comments in heapq
-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):