Re: [Numpy-discussion] question about the data entry in the __array_interface__

2013-04-07 Thread Nathaniel Smith
On Sun, Apr 7, 2013 at 2:26 PM, Valentin Haenel wrote: > I know that the address is contained in the 'data' field of the > '__array_interface__' and is either an int or a long. My guess is that > this depends on the architecture of the system, i.e. 32 vs 64 bit > systems. > > My question is: what

Re: [Numpy-discussion] question about the data entry in the __array_interface__

2013-04-07 Thread Chris Barker - NOAA Federal
On Sun, Apr 7, 2013 at 6:26 AM, Valentin Haenel wrote: > I am currently working with a C extension that wraps a C library. > > The library contains a function that takes, amongst others, a 'void *' > as an argument. Now, I would like for that function to be able to read > the 'data' buffer of a nu

Re: [Numpy-discussion] question about the data entry in the __array_interface__

2013-04-07 Thread Pauli Virtanen
07.04.2013 16:26, Valentin Haenel kirjoitti: [clip] > My question is: what is the correct type to use when using > PyArg_ParseTuple to convert the value. [clip] This is probably the most correct option: http://docs.python.org/2/c-api/long.html#PyLong_AsVoidPtr Not via ParseTuple, though. -- P

[Numpy-discussion] question about the data entry in the __array_interface__

2013-04-07 Thread Valentin Haenel
Hi, I am currently working with a C extension that wraps a C library. The library contains a function that takes, amongst others, a 'void *' as an argument. Now, I would like for that function to be able to read the 'data' buffer of a numpy array and thus need to pass address from Python down int