Commits

mattip committed c99336a

test, implement to_builtin_type for StringType

  • Participants
  • Parent commits 7175020

Comments (0)

Files changed (2)

File pypy/module/micronumpy/test/test_numarray.py

         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

File pypy/module/micronumpy/types.py

         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