On Tue, 2003-10-21 at 20:20, Guido van Rossum wrote:
Another idea: We could replace the function globals() with an object that provides __call__ for backwards compatibility, but also has a special __setattr__. Then global assignment would be 'globals.x = 23'. Would this be possible?
Yes, I just proposed this in my previous response. :-)
So maybe the idea of using function attributes isn't totally nuts, if you use a special name. E.g. outer.__locals__.x and outer.__globals__.x -Barry