From: Éric Araujo Date: Fri, 15 Apr 2011 21:34:31 +0000 (+0200) Subject: Minor tweaks to a few comments in heapq X-Git-Tag: v2.7.2rc1~85^2~1^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4800d6470cb8bb8646963123f656a9670a52334e;p=thirdparty%2FPython%2Fcpython.git Minor tweaks to a few comments in heapq --- diff --git a/Lib/heapq.py b/Lib/heapq.py index 74f7310a2cb3..fcaca1344222 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):