New submission from nestor <nestornis...@gmail.com>: >>> 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. ---------- components: Library (Lib) messages: 118568 nosy: aronacher, benjamin.peterson, georg.brandl, gpolo, mark.dickinson, nestor, rhettinger, terry.reedy priority: normal severity: normal status: open title: ast.literal_eval does not handled new set literals type: behavior versions: Python 3.1 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10091> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com