diff options
-rw-r--r-- | mdpoly/abc.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mdpoly/abc.py b/mdpoly/abc.py index 7ac21dd..c60311a 100644 --- a/mdpoly/abc.py +++ b/mdpoly/abc.py @@ -33,6 +33,9 @@ class Expr(Protocol): name = self.__class__.__qualname__ return f"{name}(left={self.left}, right={self.right})" + def nodes(self) -> Sequence[Self]: + return self.left, self.right + def leaves(self) -> Sequence[Leaf]: if isinstance(self.left, Leaf): yield self.left |