add __getitem__ and __setitem__ to Expression
This commit is contained in:
parent
1acf73c598
commit
9dbe971cd1
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user