Skip to content
Snippets Groups Projects
Commit 454228f7 authored by Kaushik Kulkarni's avatar Kaushik Kulkarni
Browse files

adds reason for defining only HeapEntry.__lt__

parent e1814a33
No related branches found
No related tags found
No related merge requests found
...@@ -180,6 +180,13 @@ class CycleError(Exception): ...@@ -180,6 +180,13 @@ class CycleError(Exception):
class HeapEntry: class HeapEntry:
"""
Helper class to compare associated keys while comparing the elements in
heap operations.
Only needs to define :func:`pytools.graph.__lt__` according to
<https://github.com/python/cpython/blob/8d21aa21f2cbc6d50aab3f420bb23be1d081dac4/Lib/heapq.py#L135-L138>.
"""
def __init__(self, node, key): def __init__(self, node, key):
self.node = node self.node = node
self.key = key self.key = key
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment