On 27/05/10 12:37, Colin H wrote:
This is a major use case for exec() - defining code from strings (e.g. enabling you to store python code in the database), and using it at runtime. It seems to me this must have been the point of locals in the first place.
I suspect that originally it just fell out of the implementation. The function in the interpreter that executes code objects requires two namespaces as arguments, and they were both exposed via exec just in case anyone found a use for them. -- 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