[Python-Dev] Showstopper in import?

Tim Peters tim.one@home.com
Fri, 2 Feb 2001 05:35:16 -0500


> Percolator has "from x import *" code. This is what is causing the
> exception.

Woo hoo!  The traceback bamboozled me:  it doesn't show any code from
Percolator.py, just the import in EditorWindow.py.  So I'll call *that* the
bug <0.7 wink>.

> I think it has already been fixed in CVS though, so should
> work again.

Doesn't work for me.  If someone does patch Percolator.py, though, it will
just blow up again at

    from IOBinding import IOBinding

.  Guido was apparently fond of this trick.

> Even though I agree that "from x import *"
> is bad style, it is quite common in testing code or code
> which imports a set of symbols from generated modules or
> modules containing only constants e.g. for protocols, error
> codes, etc.

I know I'm being brief, but please don't take that as disagreement.  It's
heading on 6 in the morning here and I've been plugging away at the release
for a loooong time.  I'm not in favor of banning "from x import *" if
there's an alternative.  But I don't grok the implementation issues in this
area well enough right now to address it; I'm also hoping that Jeremy can,
and much more quickly.

>>> Better issue a warning than raise an exception here !

>> If Jeremy can't generate correct code, a warning is too weak.

> So this is the price we pay for having nested scopes... :-(

I don't know.  It apparently is the state of the code at this instant.

sleeping-on-it<0.1-wink>-ly y'rs  - tim