]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Minor tweaks to a few comments in heapq
authorÉric Araujo <merwok@netwok.org>
Fri, 15 Apr 2011 21:34:31 +0000 (23:34 +0200)
committerÉric Araujo <merwok@netwok.org>
Fri, 15 Apr 2011 21:34:31 +0000 (23:34 +0200)
Lib/heapq.py

index 74f7310a2cb3e45f1a647f1b4d441c381bdf6ae0..fcaca1344222a0955bfd923ba483e69bc5ff3df7 100644 (file)
@@ -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):