On Fri, Aug 15, 2008 at 02:59, StÃ©fan van der Walt stefan@sun.ac.za wrote:

2008/8/15 Robert Kern robert.kern@gmail.com:

The devil is in the details. What exactly do you propose? When we discussed this last time, the participants more or less agreed that environment variables could cause more fragility than they're worth. It also breaks the first time you try to import a numpy-using library that was not written with this in mind. Basically, you're stuck with only code that you've written.

First, I propose that I write some code. Second, I do not suggest the behaviour above, but:

- Expose a new interface to numpy, called numpy.api
- If a certain environment variable is set, the numpy namespace is
not populated, and numpy.api becomes instantaneous to load.

Even if the user forgets to set the variable, everything works as planned. If the user is aware of the variable, he won't be using numpy the normal way, so the fact that numpy.* is not available won't matter.

I'm afraid that I still don't understand. Please expand on the following four cases (let's call the environment variable NUMPY_FAST_IMPORT):

1) NUMPY_FAST_IMPORT=0 (or simply absent) import numpy print dir(numpy)

2) NUMPY_FAST_IMPORT=0 import numpy.api print dir(numpy.api)

3) NUMPY_FAST_IMPORT=1 import numpy print dir(numpy)

4) NUMPY_FAST_IMPORT=1 import numpy.api print dir(numpy.api)