Skip to content

Commit e7e4766

Browse files
committed
makes HeapEntrypoint a dataclass
1 parent dc431a4 commit e7e4766

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pytools/graph.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ def __init__(self, node):
191191
self.node = node
192192

193193

194+
@dataclass(frozen=True)
194195
class HeapEntry:
195196
"""
196197
Helper class to compare associated keys while comparing the elements in
@@ -199,9 +200,8 @@ class HeapEntry:
199200
Only needs to define :func:`pytools.graph.__lt__` according to
200201
<https://github.com/python/cpython/blob/8d21aa21f2cbc6d50aab3f420bb23be1d081dac4/Lib/heapq.py#L135-L138>.
201202
"""
202-
def __init__(self, node, key):
203-
self.node = node
204-
self.key = key
203+
node: Any
204+
key: Any
205205

206206
def __lt__(self, other):
207207
return self.key < other.key

0 commit comments

Comments
 (0)