Guido van Rossum wrote: > We could easily change this to return a > writable mapping that's not a dict at all but a "view" on the locals > just as dict.keys() returns a view on a dict. I don't see why locals() > couldn't return the object used to represent the namespace, but I > don't see that it couldn't be some view on that object either, > depending on the details of the implementation.
This sounds great! I just recently wanted to pass a namespace to exec, but it refuses to accept anything but a dictionary for a local name space. What I really want to do is pass an object as the local namespace. And have the exec() use it complete with it's properties intact. Passing obj.__dict__ doesn't work in this case. Cheers, Ron _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com