Author: Matti Picus <[email protected]>
Branch:
Changeset: r61156:c99336a795d3
Date: 2013-02-13 00:25 +0200
http://bitbucket.org/pypy/pypy/changeset/c99336a795d3/
Log: test, implement to_builtin_type for StringType
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
@@ -1637,6 +1637,10 @@
builder.append("'")
return builder.build()
+ # XXX move to base class when UnicodeType is supported
+ def to_builtin_type(self, space, box):
+ return space.wrap(self.to_str(box))
+
class VoidType(BaseType, BaseStringType):
T = lltype.Char
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit