Commits

mattip  committed 711464b

test, add to_builtin_type for str

  • Participants
  • Parent commits 24d0ce5

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

     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