Author: Matti Picus <[email protected]>
Branch: mro-reorder-numpypy-str
Changeset: r65886:08e2d7b190ce
Date: 2013-08-01 22:21 +0300
http://bitbucket.org/pypy/pypy/changeset/08e2d7b190ce/
Log: a failing test
diff --git a/pypy/module/micronumpy/test/test_numarray.py
b/pypy/module/micronumpy/test/test_numarray.py
--- a/pypy/module/micronumpy/test/test_numarray.py
+++ b/pypy/module/micronumpy/test/test_numarray.py
@@ -2755,6 +2755,15 @@
assert a[2] == 'ab'
raises(TypeError, a, 'sum')
raises(TypeError, 'a+a')
+ b = array(['abcdefg', 'ab', 'cd'])
+ assert a[2] == b[1]
+ assert bool(a[1])
+
+ def test_to_str(self):
+ from numpypy import array
+ a = array(['abc', 'def', 'ab'], 'S3')
+ b = array(['abcdef', 'ab', 'cd'])
+ assert b[0] != a[0]
def test_string_scalar(self):
from numpypy import array
diff --git a/pypy/module/micronumpy/types.py b/pypy/module/micronumpy/types.py
--- a/pypy/module/micronumpy/types.py
+++ b/pypy/module/micronumpy/types.py
@@ -1758,11 +1758,11 @@
@str_binary_op
def eq(self, v1, v2):
- print 'string eq',v1,v2
return v1 == v2
@str_binary_op
def ne(self, v1, v2):
+ print 'string neq',v1,v2
return v1 != v2
@str_binary_op
@@ -1798,6 +1798,7 @@
return bool(v1) ^ bool(v2)
def bool(self, v):
+ print 'string bool',v
return bool(self.to_str(v))
def build_and_convert(self, space, mydtype, box):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit