[Numpy-discussion] __array_interface__ / __array_struct__

Travis E. Oliphant oliphant@enthought....
Tue Jan 22 15:05:52 CST 2008


Thomas Heller wrote:
> I am experimenting with implementing __array_interface__ and/or __array_struct__
> properties for ctypes instances, and have problems to create numpy arrays
> from them that share the memory.  Probably I'm doing something wrong;
> what is the correct function in numpy to create these shared objects?
>
> I am using numpy.core.multiarray.array(ctypes-object), is that correct?
>   
Yes, this should work, as the array function goes through several checks 
including looking for the __array_struct__ and/or __array_interface__ 
attributes.    If you can point me to the code, I can probably help.

-Travis O.

 



More information about the Numpy-discussion mailing list