add try in __eq__ for operator

This commit is contained in:
Benjamin Bertrand 2016-02-27 12:13:51 +03:00
parent 26e12370b8
commit 3530660c0b

View File

@ -209,7 +209,10 @@ class Operator():
def __eq__(self, op2):
""" op1 == op2 """
try:
return self.name == op2.name and self.arity == op2.arity
except AttributeError:
return False
def save_mainOp(obj, mainOp):
"""Create a temporary class build over built-in type to stock the main operation of a calculus