[Python-Dev] Package Style Guide
Greg Stein
gstein@lyra.org
Thu, 8 Jun 2000 04:43:24 -0700
On Thu, Jun 08, 2000 at 11:35:14AM +0200, Peter Funk wrote:
>...
> > Is this style evil? If so, why?
>
> I believe it will get really hard to come up with a 'namespace style guide'
> which everybody can aggree on. But who cares: let's start a rant:
>
> --> IMO 'from ... import ...' is EVIL and its use should be banned! <--
You are being overly strict here. I use this all the time:
from module import submodule
...
submodule.Class()
or even
from module.submodule import subsub
...
subsub.Blargle()
In other words, "from package import module" is a Fine Thing. It can
simplify your code without hiding where the symbols come from.
In general, I agree with you: importing symbols from a module into your
namespace is a Bad Thing.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/