[Numpy-discussion] packaging scipy (was Re: Simple financial functions for NumPy)
Mon Apr 7 12:16:22 CDT 2008
On Mon, Apr 7, 2008 at 9:57 AM, Gael Varoquaux <
> On Mon, Apr 07, 2008 at 06:22:28PM +0200, Stéfan van der Walt wrote:
> > You're only a beginner for a short while, and after that the lack of
> > namespaces really start to bite. I am all in favour of catering for
> > those who are busy learning numpy, but should we do that at the cost
> > of our advanced users?
> I agree with you. However lowering the bar is a good thing.
> > There must be a way to make both groups happy -- any suggestions?
> Hum, I am still trying to find ideas. If only "from foo.bar import baz"
> didn't import all what is in foo.__init__ !!! By the way, the standard
> solution to this problem is to use a module called "api" and not "all".
> That's what people have been doing to solve the problem we are faced
> with. If we are going to go this way, I suggest we stick to the "api"
> convention (eventhought it sucks).
I prefer 'all' for this since it has the correct meaning. 'api' assuming
that one can remember what it means doesn't fit. The 'all' module would not
contain the api, at least not the preferred api (in my book at least), but
it would contain everything.
If "from numpy.all import *" is really too complicated, which although
possible, seems a little disheartening, I suspect it would be easy enough to
have a separate module that pulled everything in so that you could use "from
big_numpy import *". Or, to preserve backward compatibility, make numpy the
unsplit namespace and expose the split namespace under a different name,
let's say 'np' because that's what I already use as a numpy abbreviation.
Then "import np" would get you just the core np functions (which I imagine
we could argue about endlessly) and the various subpackages would be
imported separately. 'np' is 'numpy' with some stuff removed: get it? OK, so
that's a weak joke, sorry.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion