1. Michael Blume
  2. pypy

Commits

Michael Blume  committed e1e6a1f

let ndarrays expose strides

  • Participants
  • Parent commits e3d7085
  • Branches stride_tricks

Comments (0)

Files changed (1)

File pypy/module/micronumpy/interp_numarray.py

View file
  • Ignore whitespace
     def descr_get_size(self, space):
         return space.wrap(self.size)
 
+    def descr_get_strides(self, space):
+        return space.newtuple([space.wrap(i) for i in self.strides])
+
     def descr_copy(self, space):
         return self.copy(space)
 
     shape = GetSetProperty(BaseArray.descr_get_shape,
                            BaseArray.descr_set_shape),
     size = GetSetProperty(BaseArray.descr_get_size),
+    strides = GetSetProperty(BaseArray.descr_get_strides),
     ndim = GetSetProperty(BaseArray.descr_get_ndim),
     itemsize = GetSetProperty(BaseArray.descr_get_itemsize),
     nbytes = GetSetProperty(BaseArray.descr_get_nbytes),