Daniel Stutzbach wrote:

No, I'm afraid Brett is quite right. Globals are looked up when the function is executed, true, but they are looked up within the module that defined the function.

I was thinking you could fix that by going over the
imported functions and stuffing the current globals
into their func_globals, but unfortunately it's
read-only. :-(

>>> f.func_globals = g
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: readonly attribute

Is there a reason it couldn't be made writeable?

--
Greg
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to