add __getitem__ and __setitem__ to Expression
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user