Message248068
exec is subtle. See the explanation linked from issue 23087, which while not *exactly* on point explains the underlying problem (a comprehension is a new scope, and exec can't reach an intermediate scope the way a compiled function can).
As far as the difference from 2.7 goes, the scoping rules for comprehensions changed in python3: the variable you are concerned with is now part of the local scope. |
|
Date |
User |
Action |
Args |
2015-08-05 19:58:18 | r.david.murray | set | recipients:
+ r.david.murray, Peter Eastman |
2015-08-05 19:58:18 | r.david.murray | set | messageid: <1438804698.33.0.705160061364.issue24800@psf.upfronthosting.co.za> |
2015-08-05 19:58:18 | r.david.murray | link | issue24800 messages |
2015-08-05 19:58:17 | r.david.murray | create | |
|