Nick Coghlan wrote: > The PEP now uses runpy for the module name, and run_module for the function > used to locate and execute scripts. There's probably some discussion to be > had > in relation to the Design Decisions section of the PEP, relating to the way I > wrote the module (the handling of locals dictionaries in particular deserves > consideration).
Huh. Speaking of not-thoroughly-tested, exec + function code objects doesn't seem to work anything like I expected, so some of my assumptions in the PEP relating to the way the locals dictionary should be handled are clearly wrong. As I discovered, the name binding operations in a function code object have no effect whatsoever on the dictionaries passed to an invocation of exec. I'll update the PEP to drop run_function_code, and make run_code a simple wrapper around the exec statement that always returns the dictionary used as 'locals' (which may happen to be the same dictionary used as 'globals'). If the way exec handles function code objects and provision of a locals dictionary ever changes, then run_code will pick up the new semantics automatically. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org _______________________________________________ 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