projects
/
pyutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f15b713
)
More docs...
author
Scott Gasch
<
[email protected]
>
Thu, 15 Dec 2022 23:47:21 +0000
(15:47 -0800)
committer
Scott Gasch
<
[email protected]
>
Thu, 15 Dec 2022 23:47:21 +0000
(15:47 -0800)
src/pyutils/collectionz/interval_tree.py
patch
|
blob
|
history
diff --git
a/src/pyutils/collectionz/interval_tree.py
b/src/pyutils/collectionz/interval_tree.py
index aee838585b098887e7b3202ca48478453978311e..7ba190a5984814eb35ff7058181cdc3a79342dd6 100644
(file)
--- 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:
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:
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:
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:
return self.low <= other.high and self.high >= other.low
def __repr__(self) -> str: