add try in __eq__ for operator
This commit is contained in:
parent
26e12370b8
commit
3530660c0b
@ -209,7 +209,10 @@ class Operator():
|
||||
|
||||
def __eq__(self, op2):
|
||||
""" op1 == op2 """
|
||||
return self.name == op2.name and self.arity == op2.arity
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user