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 | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4