diff options
author | Éric Araujo <merwok@netwok.org> | 2011-04-20 16:54:12 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-04-20 16:54:12 (GMT) |
commit | ad0790e5730173a6c649b59ae035549e3f2ba481 (patch) | |
tree | c3255b0146a5fb87c35fe15c4460606ceecdc6f5 /Lib/heapq.py | |
parent | 58de6ee8711a079da0b555221ae739d6a69df2f7 (diff) | |
parent | f8e1b607994028c826401c7f6f3637d9c797ed25 (diff) | |
download | cpython-ad0790e5730173a6c649b59ae035549e3f2ba481.zip cpython-ad0790e5730173a6c649b59ae035549e3f2ba481.tar.gz cpython-ad0790e5730173a6c649b59ae035549e3f2ba481.tar.bz2 |
Branch merge
Diffstat (limited to 'Lib/heapq.py')
-rw-r--r-- | Lib/heapq.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/heapq.py b/Lib/heapq.py index b74818e..cc61294 100644 --- a/Lib/heapq.py +++ b/Lib/heapq.py @@ -172,7 +172,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, @@ -363,7 +363,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): @@ -401,7 +401,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): |