Another approach to all this might be to generalise the mechanism by which a lookup of the globals falls back to a lookup of __builtins__.
If this were done recursively, then the "stuff" could be attached to the globals dict, e.g. stuff['__builtins__'] = __builtins__ g = dict(__builtins__ = stuff) exec(code, g) del g['__builtins__'] -- 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