[Python-Dev] variable name resolution in exec is incorrect (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Thu May 27 01:38:50 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 ]
Mark Dickinson wrote:
_code = """_ ... y = 3 ... def f(): ... return y ... f() ... """
exec code in {} # works fine exec code in {}, {} # dies with a NameError
Seems to me the whole idea of being able to specify separate global and local scopes for top-level code is screwy in the first place. Are there any use cases for it? Maybe the second scope argument to exec() should be deprecated?
-- 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 ]