[Numpy-discussion] slow import of numpy modules
David Cournapeau
cournapeau at cslab.kecl.ntt.co.jp
Wed Jul 2 21:23:59 EDT 2008
On Wed, 2008-07-02 at 17:00 -0700, Michael McNeil Forbes wrote:
>
> One could use an environmental variable such as
> NUMPY_SUPPRESS_TOP_LEVEL_IMPORTS, that, if defined, suppresses the
> importing of unneeded packages. This would only affect systems that
> define this variable, thus not breaking the API but providing the
> flexibility for those that need it. (This or a similar variable
> could also contain a list of the numpy components to import
> automatically.)
This does not sound like a good idea to me. It would mean that you
effectively have two code paths depending on the environment variable,
with more problems to support (people would use this option, but many
other software would break without them knowing why; typically, scipy
would not work anymore).
I think that import numpy.core being slower than import numpy is a bug
which can be solved without breaking anything, though.
cheers,
David
More information about the NumPy-Discussion
mailing list