Commits

Antonio Cuni  committed 33b3cb9

there is no need to pass through the extradata for these two

  • Participants
  • Parent commits 0bd5ff6

Comments (0)

Files changed (1)

File numpypy_c/impl.py

 @ffi.callback("npy_intp(PyObject*, int)")
 def PyArray_DIM(addr, i):
     array = from_C(addr)
-    return ExtraData.get(array).dims[i]
+    return array.shape[i]
 
 @ffi.callback("PyObject*(PyObject*)")
 def PyArray_Return(addr):
 @ffi.callback("npy_intp(PyObject*, int)")
 def PyArray_STRIDE(addr, i):
     array = from_C(addr)
-    return ExtraData.get(array).strides[i]
+    return array.strides[i]