Commits

Romain Guillebert committed b98e6b4

Remove dead code

  • Participants
  • Parent commits 950a858

Comments (0)

Files changed (2)

pypy/module/micronumpy/test/test_dtypes.py

         from numpypy import array, dtype
         from cPickle import loads, dumps
         a = array([1,2,3])
-         if self.ptr_size == 8:
+        if self.ptr_size == 8:
             assert a.dtype.__reduce__() == (dtype, ('i8', 0, 1), (3, '<', None, None, None, -1, -1, 0))
         else:
             assert a.dtype.__reduce__() == (dtype, ('i4', 0, 1), (3, '<', None, None, None, -1, -1, 0))

pypy/module/micronumpy/types.py

     T = lltype.Char
 
     def _coerce(self, space, arr, ofs, dtype, w_items, shape):
-        items_w = space.fixedview(w_items)
-        for i in range(len(items_w)):
-            subdtype = dtype.subdtype
-            itemtype = subdtype.itemtype
-            if space.len_w(shape) <= 1:
-                w_box = itemtype.coerce(space, dtype.subdtype, items_w[i])
-                itemtype.store(arr, 0, ofs, w_box)
-                ofs += itemtype.get_element_size()
-            else:
-                size = 1
-                for dimension in shape[1:]:
-                    size *= dimension
-                size *= itemtype.get_element_size()
-                for w_item in items_w:
-                    self._coerce(space, arr, ofs, dtype, w_items, shape[1:])
-                    ofs += size
-        return arr
-
-    def _coerce(self, space, arr, ofs, dtype, w_items, shape):
         # TODO: Make sure the shape and the array match
         items_w = space.fixedview(w_items)
         subdtype = dtype.subdtype