__eq__ return false if other can't be converted to polynom
This commit is contained in:
parent
d5d889eeb0
commit
4b5dabd12c
@ -312,8 +312,11 @@ class Polynom(object):
|
|||||||
return self.reduce()
|
return self.reduce()
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
|
try:
|
||||||
o_poly = self.conv2poly(other)
|
o_poly = self.conv2poly(other)
|
||||||
return self._coef == o_poly._coef
|
return self._coef == o_poly._coef
|
||||||
|
except TypeError:
|
||||||
|
return 0
|
||||||
|
|
||||||
def __add__(self, other):
|
def __add__(self, other):
|
||||||
steps = []
|
steps = []
|
||||||
|
Loading…
Reference in New Issue
Block a user