Message248076
Yes it is. The comprehension is a *new* scope, within the outer scope of the exec, and it *cannot see* the variables in the outer scope of the exec. You have the same problem if you try to use a comprehension in that way in a class statement at the class level. An exec is explicitly *not* equivalent to a function body. It is equivalent to operating in a class body, if you give it two namespaces, and in a global context if you give it one. This is documented.
Please don't reopen the issue. |
|
Date |
User |
Action |
Args |
2015-08-05 20:42:01 | r.david.murray | set | recipients:
+ r.david.murray, Peter Eastman |
2015-08-05 20:42:01 | r.david.murray | set | messageid: <1438807321.07.0.365606208139.issue24800@psf.upfronthosting.co.za> |
2015-08-05 20:42:01 | r.david.murray | link | issue24800 messages |
2015-08-05 20:42:00 | r.david.murray | create | |
|