diff --git a/pymath/expression.py b/pymath/expression.py index e230ff0..f27478f 100644 --- a/pymath/expression.py +++ b/pymath/expression.py @@ -147,6 +147,15 @@ class Expression(object): return 0 return 1 + # ----------- + # Expression act as container from self.postfix_tokens + + def __getitem__(self, index): + return self.postfix_tokens[index] + + def __setitem__(self, index, value): + self.postfix_tokens[index] = value + # ----------- # Some math manipulations