diff options
| author | Éric Araujo <merwok@netwok.org> | 2011-04-24 00:39:43 (GMT) |
|---|---|---|
| committer | Éric Araujo <merwok@netwok.org> | 2011-04-24 00:39:43 (GMT) |
| commit | cae1be85f5ac78a7ec73d129ca46cdfc5c5a5ad9 (patch) | |
| tree | 786ea49a8c479b6cc89f6801925bcadd3786c9b5 /Lib/heapq.py | |
| parent | 5569e9b1507ac0ff18fec433a7733a0185dde7b0 (diff) | |
| parent | 37e6c54ba122703a0162dd44cf3eac78c46c8bdd (diff) | |
| download | cpython-cae1be85f5ac78a7ec73d129ca46cdfc5c5a5ad9.zip cpython-cae1be85f5ac78a7ec73d129ca46cdfc5c5a5ad9.tar.gz cpython-cae1be85f5ac78a7ec73d129ca46cdfc5c5a5ad9.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 3fe6b46..f756035 100644 --- a/Lib/heapq.py +++ b/Lib/heapq.py @@ -170,7 +170,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, @@ -360,7 +360,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): @@ -398,7 +398,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): |
