[Numpy-discussion] Fwd: PyArray_DescrConverter segfault
Thu Jan 1 16:25:21 CST 2009
If I import numpy and then import a 3rd party extension module, why does the
extension module still have to call import_array if numpy sets this array in
the first place? I assume that there's a single array of API functions in a
single python process with multiple extension modules.
On Thu, Jan 1, 2009 at 4:11 PM, Robert Kern <firstname.lastname@example.org> wrote:
> On Thu, Jan 1, 2009 at 14:21, Igor Sylvester <email@example.com> wrote:
> > I realize I need to call import_array() in the module initialization
> > module. Why isn't this equivalent to importing numpy before importing my
> > module?
> In 3rd party extension modules, all of the PyArray_* API functions are
> actually #define macros pointing to an array of function pointers.
> import_array() imports numpy.core.multiarray and sets up this array.
> If you don't do this, then trying to call one of the PyArray_*
> functions will result in a segfault because it tries to dereference a
> pointer in the array that is not set up.
> 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
> Numpy-discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion