aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2024-03-08 02:30:50 +0100
committerNao Pross <np@0hm.ch>2024-03-08 02:30:50 +0100
commit399e1d3f420de471ccca803044df0b2fb07518c6 (patch)
tree9f00a3ca6b476949e8c742ae554e79cbeba11cda
parentReplace hash() with hashlib.sha256() for robustness to collision (diff)
downloadmdpoly-399e1d3f420de471ccca803044df0b2fb07518c6.tar.gz
mdpoly-399e1d3f420de471ccca803044df0b2fb07518c6.zip
Fix missing edge case in Expr.children
-rw-r--r--mdpoly/abc.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/mdpoly/abc.py b/mdpoly/abc.py
index 36cb1c3..14026d6 100644
--- a/mdpoly/abc.py
+++ b/mdpoly/abc.py
@@ -120,6 +120,8 @@ class Expr(ABC):
def children(self) -> Sequence[Expr]:
""" Iterate over the two nodes """
+ if self.is_leaf:
+ return tuple()
return self.left, self.right
def leaves(self) -> Iterable[Expr]: