Author: mattip <[email protected]>
Branch:
Changeset: r61146:711464be0c98
Date: 2013-02-12 21:29 +0200
http://bitbucket.org/pypy/pypy/changeset/711464be0c98/
Log: test, add to_builtin_type for str
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
@@ -2195,6 +2195,8 @@
assert (a + a).item(1) == 4
raises(IndexError, "array(5).item(1)")
assert array([1]).item() == 1
+ a = array('x')
+ assert a.item() == 'x'
def test_int_array_index(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
@@ -1593,6 +1593,9 @@
def get_size(self):
return self.size
+ def to_builtin_type(self, space, box):
+ return space.wrap(self.to_str(box))
+
class StringType(BaseType, BaseStringType):
T = lltype.Char
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit