diff options
-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]: |