New submission from Jiafei Peng <[email protected]>:
Jiafei Peng <[email protected]> added the comment:
Yes
it does work properly outside listcomps.
canBusType = 'CANdiag'
result1 = eval('canBusType')
result2 = [eval('canBusType'), eval('canBusType'), eval(
'canBusType')]
result3 = [eval('canBusType') for i in range(3)]
result1 = 'CANdiag'
result2 =['CANdiag' 'CANdiag' 'CANdiag']
for result3:
NameError: name 'canBusType' is not defined
Best regards, mit freundlichen Grüßen,
Jiafei Peng
IAV GmbH
Nordhoffstr. 5
38518 Gifhorn
GERMANY
Phone: +49 5371 805-2817
Fax:+49 5371 805-1330
Ezio Melotti <[email protected]>
13.02.2009 11:04
Bitte antworten an
Python tracker <[email protected]>
An
[email protected]
Kopie
Thema
[issue5242] eval() function in List Comprehension doesn't work
Ezio Melotti <[email protected]> added the comment:
I can't reproduce it either, tested with Py3 (on Linux and Windows) and
with Py2.[456], it worked fine everywhere.
Does your eval() work properly outside listcomps?
----------
messages: 81899
nosy: JiafeiPeng
severity: normal
status: open
title: Python 3.0 eval() function in List Comprehension doesn't work
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue5244>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com