diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/mllib/dom.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/python/mllib/dom.py b/python/mllib/dom.py index 7c759dbdd5..df2b88322a 100644 --- a/python/mllib/dom.py +++ b/python/mllib/dom.py @@ -185,7 +185,24 @@ class Comment(Leaf): ## Query Classes ## ########################################################################### -class View: +class Adder: + + def __add__(self, other): + return Sum(self, other) + +class Sum(Adder): + + def __init__(self, left, right): + self.left = left + self.right = right + + def __iter__(self): + for x in self.left: + yield x + for x in self.right: + yield x + +class View(Adder): def __init__(self, source): self.source = source |
