[Numpy-discussion] Use of PyArray_FromAny() with a PyArrayInterface object

Matthieu Brucher matthieu.brucher@gmail....
Fri Oct 12 04:56:30 CDT 2007


Hi,

I'm trying to understand (but perhaps everything is in the numpy book in
which case I'd rather buy the book immediately) how to use the
PyArray_FromAny() function.
Suppose I have a C object (created by Pyrex or SWIG or Boost.Python) that
has the __array_struct__ attribute. Can I pass this object to the
PyArray_FromAny() function to get a PyArrayObject ?
If it is not the case, if I have a PyCObject created with a
PyArrayInterface, is it possible ?
I read on a mailing-list that there is the context argument that can be
passed to an __array__ method. What is the purpose of this __array__ method
? I don't recollect anything regarding this method :(

Matthieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20071012/684f06d7/attachment-0001.html 


More information about the Numpy-discussion mailing list