[Cython] A few suggestions for the numpy tutorial documentation...
Robert Bradshaw
robertwb at math.washington.edu
Tue Apr 28 20:04:59 CEST 2009
On Apr 28, 2009, at 11:01 AM, Robert Kern wrote:
> On 2009-04-28 01:05, Dag Sverre Seljebotn wrote:
> [Mike Fletcher wrote:]
>>> * You have to call import_array() in your module or many of the
>>> Numpy C API entry points will segfault
>>
>> Are you sure about this? I never do it. I know you need to do it
>> from C
>> code, but is it not enough in Cython to do
>>
>> import numpy
>>
>> ?
>
> If you call any of the PyArray_* functions, you will need an
> import_array()
> call. That does not just import numpy; it sets up the function
> pointer table in
> your extension module such that the PyArray_* #defines reference
> the right
> functions.
So "import numpy" doesn't call import_array() then?
- Robert
More information about the Cython-dev
mailing list