summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/tests/test_regression.py7
-rw-r--r--numpy/lib/polynomial.py4
2 files changed, 9 insertions, 2 deletions
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
index e5fb33a73..88187e35a 100644
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -702,6 +702,13 @@ class test_regression(NumpyTestCase):
from numpy.oldnumeric.random_array import randint
randint(0,50,[2,3])
+ def check_poly_eq(self, level=rlevel):
+ """Ticket #554"""
+ x = N.poly1d([1,2,3])
+ y = N.poly1d([3,4])
+ assert x != y
+ assert x == x
+
if __name__ == "__main__":
NumpyTest().run()
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py
index edaa319cd..8231cbd87 100644
--- a/numpy/lib/polynomial.py
+++ b/numpy/lib/polynomial.py
@@ -606,10 +606,10 @@ class poly1d(object):
return polydiv(other, self)
def __eq__(self, other):
- return (self.coeffs == other.coeffs).all()
+ return NX.alltrue(self.coeffs == other.coeffs)
def __ne__(self, other):
- return (self.coeffs != other.coeffs).any()
+ return NX.any(self.coeffs != other.coeffs)
def __setattr__(self, key, val):
raise ValueError, "Attributes cannot be changed this way."