Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
API Make PyArray_DATA return void* #2780
PyArray_DATA is documented as returning void_. Changing it to return
PyArray_BYTES returns char*, but is otherwise the same function.
My main argument is that http://docs.scipy.org/doc/numpy/reference/c-api.array.html clearly states that PyArray_DATA returns
I believe the theano folks used PyArray_BYTES, I was responsible for the PyArray_DATA change. Numpy 1.6 didn't have the cast in PyArray_BYTES, it was new in 1.7. @nouiz, can you confirm that you only need to use PyArray_BYTES?
If we make this change, then the corresponding function should probably return void* also. I'm not a big fan of void* but we should probably keep backwards compatibility here. We still need a function to do the equivalent of std::vector swap, but that isn't pressing.