We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4fd94a commit cebbc88Copy full SHA for cebbc88
Lib/test/test_heapq.py
@@ -111,9 +111,9 @@ def check_invariant(self, heap):
111
self.assertTrue(heap[parentpos] <= item)
112
113
def check_max_invariant(self, heap):
114
- for pos in range(1, len(heap)):
+ for pos, item in enumerate(heap[1:], start=1):
115
parentpos = (pos - 1) >> 1
116
- self.assertGreaterEqual(heap[parentpos], heap[pos])
+ self.assertGreaterEqual(heap[parentpos], item)
117
118
def test_heapify(self):
119
for size in list(range(30)) + [20000]:
0 commit comments