From 1d5a725635a7aa1eda01b347559337062577356e Mon Sep 17 00:00:00 2001 From: nrubin29 Date: Mon, 4 Dec 2017 17:45:50 -0500 Subject: [PATCH] Cleaned up Value superclass. --- vartypes.py | 43 ++----------------------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/vartypes.py b/vartypes.py index 04831e8..87baebc 100644 --- a/vartypes.py +++ b/vartypes.py @@ -16,47 +16,8 @@ def __init__(self): def __str__(self): return str(self.value) - def pos(self): - raise EvaluationException('Operation not defined for ' + self.type) - - def neg(self): - raise EvaluationException('Operation not defined for ' + self.type) - - def add(self, other): - raise EvaluationException('Operation not defined for ' + self.type) - - def sub(self, other): - raise EvaluationException('Operation not defined for ' + self.type) - - def mul(self, other): - raise EvaluationException('Operation not defined for ' + self.type) - - def div(self, other): - raise EvaluationException('Operation not defined for ' + self.type) - - def mod(self, other): - raise EvaluationException('Operation not defined for ' + self.type) - - def pow(self, other): - raise EvaluationException('Operation not defined for ' + self.type) - - def sqrt(self): - raise EvaluationException('Operation not defined for ' + self.type) - - def exp(self): - raise EvaluationException('Operation not defined for ' + self.type) - - def identity(self): - raise EvaluationException('Operation not defined for ' + self.type) - - def solve(self, other): - raise EvaluationException('Operation not defined for ' + self.type) - - def eval(self, other): - raise EvaluationException('Operation not defined for ' + self.type) - - def ls(self, other): - raise EvaluationException('Operation not defined for ' + self.type) + def __getattr__(self, item): + raise EvaluationException('{} does not have operation {}'.format(self.type, item)) class VariableValue(Value):