circular imports (don't yell!)

Peter Hansen peter at engcorp.com
Sat Mar 23 02:09:04 EST 2002


Sean 'Shaleh' Perry wrote:
> 
> >
> > Also, do you realize that "from X import *" is a bad idea
> > in general?  I'll assume that was just something you did
> > to try to reproduce the problem in a small sample program...
> >
> 
> in his defense, the gui libs often expect you have done a from X import *.
> otherwise your commands are fiendishly long and ugly.
> 
> win = gui.create_window(gui.top_level, gui.foo, gui.bar)

If he's writing the equivalent of the GUI libs, I take your point.
Though I admit there are specific cases where that's a valid thing 
to do (I did say "bad idea _in general_", not "bad idea always"),
I suspect this is not one of those cases.  Or at least I was just
trying to caution him in case he didn't know about that guideline.

-Peter



More information about the Python-list mailing list