summaryrefslogtreecommitdiff
path: root/numpy/lib/polynomial.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/polynomial.py')
-rw-r--r--numpy/lib/polynomial.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py
index f00d95b6c..6c0c11ac6 100644
--- a/numpy/lib/polynomial.py
+++ b/numpy/lib/polynomial.py
@@ -1199,11 +1199,15 @@ class poly1d(object):
__rtruediv__ = __rdiv__
def __eq__(self, other):
+ if not isinstance(other, poly1d):
+ return NotImplemented
if self.coeffs.shape != other.coeffs.shape:
return False
return (self.coeffs == other.coeffs).all()
def __ne__(self, other):
+ if not isinstance(other, poly1d):
+ return NotImplemented
return not self.__eq__(other)
def __setattr__(self, key, val):