From eebe93c17138e2186f9e3bd029bc7d69dd91f242 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Thu, 15 Dec 2022 15:47:21 -0800 Subject: [PATCH] More docs... --- src/pyutils/collectionz/interval_tree.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/pyutils/collectionz/interval_tree.py b/src/pyutils/collectionz/interval_tree.py index aee8385..7ba190a 100644 --- a/src/pyutils/collectionz/interval_tree.py +++ b/src/pyutils/collectionz/interval_tree.py @@ -43,15 +43,27 @@ class NumericRange(object): self.highest_in_subtree: Numeric = high def __lt__(self, other: NumericRange) -> bool: + """ + Returns: + True is this range is less than (lower low) other, else False. + """ return self.low < other.low @overrides def __eq__(self, other: object) -> bool: + """ + Returns: + True if this is the same range as other, else False. + """ if not isinstance(other, NumericRange): return False return self.low == other.low and self.high == other.high def overlaps_with(self, other: NumericRange) -> bool: + """ + Returns: + True if this NumericRange overlaps with other, else False. + """ return self.low <= other.high and self.high >= other.low def __repr__(self) -> str: -- 2.45.2