diff --git a/Equation/core.py b/Equation/core.py index 4574feb..96127a1 100644 --- a/Equation/core.py +++ b/Equation/core.py @@ -272,6 +272,8 @@ def __call__(self,*args,**kwargs): varies Result of evaluating the Expression, type will depende appon the expression and the variables used to evaluate the expression. """ + if len(self.__expr) == 0: + return None self.variables = {} self.variables.update(constants) # i.e. pi, e, i, etc. self.variables.update(self.__vars) diff --git a/tests/test_Equation.py b/tests/test_Equation.py index fd20bbe..20721e0 100755 --- a/tests/test_Equation.py +++ b/tests/test_Equation.py @@ -75,9 +75,9 @@ def testRepr(self): def testStr(self): self.assertEqual(str(self.fn),"") - + def testCall(self): - self.assertEqual(self.fn(), 0) + self.assertEqual(self.fn(), None) def tearDown(self): pass