[Python-Dev] Python3 compiled listcomp can't see local var (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Mon Jun 11 19:08:50 EDT 2018
- Previous message (by thread): [Python-Dev] Python3 compiled listcomp can't see local var - bug or feature?
- Next message (by thread): [Python-Dev] Python3 compiled listcomp can't see local var - bug or feature?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Skip Montanaro wrote:
Yes, you'll have to pass in locals to exec.
Exec changed between python 2 and 3. It used to be treated specially by the compiler so that it could see and modify the locals where it was used. But now it's just an ordinary function, so you can't expect it to magically know about anything that's not passed into it.
-- Greg
- Previous message (by thread): [Python-Dev] Python3 compiled listcomp can't see local var - bug or feature?
- Next message (by thread): [Python-Dev] Python3 compiled listcomp can't see local var - bug or feature?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]