From 399e1d3f420de471ccca803044df0b2fb07518c6 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Fri, 8 Mar 2024 02:30:50 +0100 Subject: Fix missing edge case in Expr.children --- mdpoly/abc.py | 2 ++ 1 file changed, 2 insertions(+) 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]: -- cgit v1.2.1