On Wed, May 4, 2011 at 2:57 AM, Chris Rebert <c...@rebertia.com> wrote:
> from foo import *
>
> can be thought of as essentially doing:
>
> import foo
> set = foo.set
> var = foo.var
> del foo

Here's a side point. What types will hold a reference to the enclosing
module (or at least its dictionary)? Would it be possible to use a
from import to load a module, then "lose" the module even though
you're using objects from it?

I am guessing that a function or class will hold such a reference,
because otherwise it would be a bit awkward for them to use any sort
of module-level state. Or do they not, and instead go look for their
module in sys.modules?

Chris Angelico
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to