importing symbols from module objects

Peter Hansen peter at engcorp.com
Wed Sep 26 09:55:48 EDT 2001


Paul Rubin wrote:
> 
> Don O'Donnell <donod at home.com> writes:
> > I'm probably missing something here, but why not just:
> >
> > SpamException = breakfastdish.SpamException
> 
> Hey, that ought to work.  I'm the one that missed something.  I'm not
> totally used to this exceptions=classes=instances stuff yet.  Now I
> have to wonder what "from foo import bar as parrot" really does.
> Maybe pretty much the same thing.  Anyway, thanks, I'll give it a try.

It does this:

from foo import bar
parrot = bar
del bar

-- 
----------------------
Peter Hansen, P.Eng.
peter at engcorp.com



More information about the Python-list mailing list