variable scoping across imports?

Kragen Sitaker kragen at pobox.com
Sat Dec 1 18:30:41 EST 2001


Hans Nowak <wurmy at earthlink.net> writes:
> Let's see... you start x.py... x imports y... y imports x again...
> at that moment x.z0 is None. Now y has a copy of x's namespace with
> z0 == None. This is, however, not the same as the global namespace
> you're currently in. set() changes z0 to 33, but it does *not*
> affect the x module that was imported by y.

I don't think things work this way, actually, although I'm at a loss
to understand why the original poster's question doesn't work.




More information about the Python-list mailing list