Message81890
eval() function in List Comprehension doesn't work.
please see the under codes:
canBusType = 'CANdiag'
result = [eval('canBusType') for i in range(3)]
NameError: name 'canBusType' is not defined
It did work in Python2.5 or 2.6. The expected result is
['CANdiag', 'CANdiag', 'CANdiag']. |
|
Date |
User |
Action |
Args |
2009-02-13 09:42:06 | JiafeiPeng | set | recipients:
+ JiafeiPeng |
2009-02-13 09:42:05 | JiafeiPeng | set | messageid: <1234518125.96.0.444530348539.issue5242@psf.upfronthosting.co.za> |
2009-02-13 09:42:04 | JiafeiPeng | link | issue5242 messages |
2009-02-13 09:42:04 | JiafeiPeng | create | |
|