[Python-Dev] variable name resolution in exec is incorrect (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Thu May 27 05:47:26 CEST 2010
- Previous message: [Python-Dev] variable name resolution in exec is incorrect
- Next message: [Python-Dev] variable name resolution in exec is incorrect
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-Dev] variable name resolution in exec is incorrect
- Next message: [Python-Dev] variable name resolution in exec is incorrect
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]