diff options
author | Nao Pross <np@0hm.ch> | 2024-03-08 02:30:50 +0100 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2024-03-08 02:30:50 +0100 |
commit | 399e1d3f420de471ccca803044df0b2fb07518c6 (patch) | |
tree | 9f00a3ca6b476949e8c742ae554e79cbeba11cda | |
parent | Replace hash() with hashlib.sha256() for robustness to collision (diff) | |
download | mdpoly-399e1d3f420de471ccca803044df0b2fb07518c6.tar.gz mdpoly-399e1d3f420de471ccca803044df0b2fb07518c6.zip |
Fix missing edge case in Expr.children
-rw-r--r-- | mdpoly/abc.py | 2 |
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]: |