[Numpy-discussion] Exported symbols and code reorganization.

Robert Kern robert.kern at gmail.com
Wed Jan 10 18:29:07 EST 2007

Charles R Harris wrote:

> Is there a reason that the pointer PyArray_API remains valid if the
> imported numpy module is garbage collected? Or is the imported module
> persistent even though the returned object goes away? I assume that
> python did a dlopen somewhere.

There is no provision in Python for safely unloading a C extension module, so we
simply presume that sys.modules always holds a reference to the imported module
and doesn't let it get garbage collected. People who futz with that get the
segfaults they deserve.  ;-)

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

More information about the NumPy-Discussion mailing list