Message377653
Looks like the list generator is considered as a new nested scope, which prohibits access to local variables?
This basic expression, passing local symbols only, fails as well:
eval('[abc[i]*abc[i] for i in [0, 1, 2]]', {}, dict(abc=[1, 2, 3]))
while this one, passing dict as global symbols, works:
eval('[abc[i]*abc[i] for i in [0, 1, 2]]', dict(abc=[1, 2, 3]))
However, passing globals must be a real dict. So I cannot simply pass my custom mapping to globals. |
|
Date |
User |
Action |
Args |
2020-09-29 04:46:11 | Robert Haschke | set | recipients:
+ Robert Haschke |
2020-09-29 04:46:11 | Robert Haschke | set | messageid: <1601354771.67.0.486953895644.issue41878@roundup.psfhosted.org> |
2020-09-29 04:46:11 | Robert Haschke | link | issue41878 messages |
2020-09-29 04:46:11 | Robert Haschke | create | |
|