Commits

Brian Kearns  committed a93131d

partially fix scalar record getitem

  • Participants
  • Parent commits b29074f

Comments (0)

Files changed (2)

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

         from numpypy import zeros
         a = [('x', int), ('y', float)]
         b = [('x', int), ('y', a)]
+        arr = zeros((), dtype=b)
+        assert arr['x'] == 0
+        arr['y']
+        #assert arr['y'].shape == ()
+        #assert arr['y'][()][0] == 0
+        #assert arr['y'][()][0] == 0
         arr = zeros(3, dtype=b)
         arr[1]['x'] = 15
         assert arr[1]['x'] == 15

File pypy/module/micronumpy/types.py

     @jit.unroll_safe
     def store(self, arr, i, ofs, box):
         assert isinstance(box, interp_boxes.W_VoidBox)
-        for k in range(box.arr.dtype.get_size()):
+        for k in range(box.dtype.get_size()):
             arr.storage[k + i] = box.arr.storage[k + box.ofs]
 
     def to_builtin_type(self, space, box):