Skip to content

Commit 3cde6c6

Browse files
Benedikts suggestion
1 parent cebbc88 commit 3cde6c6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Doc/library/heapq.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
This module provides an implementation of the heap queue algorithm, also known
1717
as the priority queue algorithm.
1818

19-
in-heaps (resp. max-heaps) are binary trees for which every parent node
19+
Min-heaps (resp. max-heaps) are binary trees for which every parent node
2020
has a value less than (resp. greater than) or equal to any of its children.
2121
We refer to this condition as the heap invariant. Unless stated otherwise,
2222
*heaps* refer to min-heaps.
@@ -96,7 +96,7 @@ For max-heaps, the reverse of a heap, the following functions are provided:
9696

9797
.. function:: heappush_max(heap, item)
9898

99-
Push the value *item* onto the max-*heap*, maintaining the heap invariant.
99+
Push the value *item* onto the max-heap *heap*, maintaining the heap invariant.
100100

101101
.. versionadded:: next
102102

Lib/test/test_heapq.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ def test_push_pop(self):
6868
self.check_invariant(results)
6969

7070
self.assertRaises(TypeError, self.module.heappush, [])
71-
try:
72-
self.assertRaises(TypeError, self.module.heappush, None, None)
73-
self.assertRaises(TypeError, self.module.heappop, None)
74-
except AttributeError:
75-
pass
71+
72+
exc_types = (AttributeError, TypeError)
73+
self.assertRaises(exc_types, self.module.heappush, None, None)
74+
self.assertRaises(exc_types, self.module.heappop, None)
75+
7676

7777
def test_max_push_pop(self):
7878
# 1) Push 256 random numbers and pop them off, verifying all's OK.

0 commit comments

Comments
 (0)