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.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to