2009/11/16 Robert Kern <robert.k...@gmail.com>: > On Mon, Nov 16, 2009 at 18:05, Christopher Barker <chris.bar...@noaa.gov> > wrote: >> Charles R Harris wrote: >>> That's what I ended up doing. You still need to do "import >>> numpy.polynomial" to get to them, they aren't automatically imported >>> into the numpy namespace. >> >> good start. This brings up a semi-off-topic question: >> >> Is there a way to avoid importing everything when importing a module >> deep in a big package? > > The package authors need to keep the __init__.py files clear. There is > nothing you can do as a user.
The reason numpy and scipy don't do this is largely historical - Numeric had a nearly flat namespace, and imported all the submodules in any case, and numpy is trying to remain somewhat compatible; scipy originally tried to reexport all the numpy symbols, for some reason, and there too it is maintaining compatibility. Since spatial is new, though, it should be pretty good about not inflating your imports unnecessarily. It does, of course, import various things itself, which may balloon out the imports. Anne > -- > 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 > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion > _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion