Message118568
>>> import ast
>>> eval('{1:11,2:22}')
{1: 11, 2: 22}
>>> ast.literal_eval('{1:11,2:22}')
{1: 11, 2: 22}
>>> eval('{1,2}')
{1, 2}
>>> ast.literal_eval('{1,2}')
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
ast.literal_eval('{1,2}')
File "C:\Python31\lib\ast.py", line 80, in literal_eval
return _convert(node_or_string)
File "C:\Python31\lib\ast.py", line 79, in _convert
raise ValueError('malformed string')
ValueError: malformed string
>>>
I haven't tested for 2.7 or 3.2 but this bug probably applies also there. |
|
Date |
User |
Action |
Args |
2010-10-13 19:36:42 | nestor | set | recipients:
+ nestor, georg.brandl, rhettinger, terry.reedy, mark.dickinson, benjamin.peterson, gpolo, aronacher |
2010-10-13 19:36:42 | nestor | set | messageid: <1286998602.58.0.486068120725.issue10091@psf.upfronthosting.co.za> |
2010-10-13 19:36:40 | nestor | link | issue10091 messages |
2010-10-13 19:36:40 | nestor | create | |
|