From 3530660c0bc5012e8677ce4a8d4104a28077941e Mon Sep 17 00:00:00 2001 From: Benjamin Bertrand Date: Sat, 27 Feb 2016 12:13:51 +0300 Subject: [PATCH] add try in __eq__ for operator --- pymath/calculus/operator/operator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pymath/calculus/operator/operator.py b/pymath/calculus/operator/operator.py index 5dd6897..8c8bd75 100644 --- a/pymath/calculus/operator/operator.py +++ b/pymath/calculus/operator/operator.py @@ -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