[Numpy-discussion] Adding the new polynomial/chebyshev modules.
Mon Nov 16 18:29:09 CST 2009
2009/11/16 Robert Kern <firstname.lastname@example.org>:
> On Mon, Nov 16, 2009 at 18:05, Christopher Barker <Chris.Barker@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.
> 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
More information about the NumPy-Discussion