import x as y

Delaney, Timothy tdelaney at avaya.com
Mon Oct 30 01:48:22 EST 2000


> > import x
> > y = x
> > del x
> > 
> > *does* pollute the local namespace for a short while (if 
> you already have x
> > in the local namespace it will get rebound to the module). Does
> > 
> > import x as y
> > 
> > still pollute for that period of time, or is x *never* in the local
> > namespace?
> 
> No, it's actually closer to
> 
> y = __import__("x")

That's what I expected ... but I wanted to be sure. Couldn't find anything
in the docs which told be explicitly.

Tim Delaney
Avaya Australia




More information about the Python-list mailing list