Author: Brian Kearns <[email protected]>
Branch: 
Changeset: r67472:05a9b19c2e61
Date: 2013-10-17 21:33 -0400
http://bitbucket.org/pypy/pypy/changeset/05a9b19c2e61/

Log:    fix dtype descr_eq

diff --git a/pypy/module/micronumpy/interp_dtype.py 
b/pypy/module/micronumpy/interp_dtype.py
--- a/pypy/module/micronumpy/interp_dtype.py
+++ b/pypy/module/micronumpy/interp_dtype.py
@@ -148,7 +148,11 @@
 
     def eq(self, space, w_other):
         w_other = space.call_function(space.gettypefor(W_Dtype), w_other)
-        return space.is_w(self, w_other)
+        if space.is_w(self, w_other):
+            return True
+        if isinstance(w_other, W_Dtype):
+            return space.eq_w(self.descr_reduce(space), 
w_other.descr_reduce(space))
+        return False
 
     def descr_eq(self, space, w_other):
         return space.wrap(self.eq(space, w_other))
diff --git a/pypy/module/micronumpy/test/test_dtypes.py 
b/pypy/module/micronumpy/test/test_dtypes.py
--- a/pypy/module/micronumpy/test/test_dtypes.py
+++ b/pypy/module/micronumpy/test/test_dtypes.py
@@ -703,7 +703,7 @@
         from numpypy import dtype
         nnp = self.non_native_prefix
         byteorder = self.native_prefix
-        assert dtype('i8') == dtype(byteorder + 'i8') == dtype('=i8') # XXX 
should be equal == dtype(long)
+        assert dtype('i8') == dtype(byteorder + 'i8') == dtype('=i8') == 
dtype(long)
         assert dtype(nnp + 'i8') != dtype('i8')
         assert dtype(nnp + 'i8').byteorder == nnp
         assert dtype('=i8').byteorder == '='
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to