From 454228f7aed21c92c5dcdf92ee9c998996252cc3 Mon Sep 17 00:00:00 2001 From: Kaushik Kulkarni <kaushikcfd@gmail.com> Date: Fri, 31 Jul 2020 17:56:32 -0500 Subject: [PATCH] adds reason for defining only HeapEntry.__lt__ --- pytools/graph.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pytools/graph.py b/pytools/graph.py index 3464422..a00fe31 100644 --- a/pytools/graph.py +++ b/pytools/graph.py @@ -180,6 +180,13 @@ class CycleError(Exception): 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): self.node = node self.key = key -- GitLab