[issue13536] ast.literal_eval fails on sets

2011-12-06 Thread Georg Brandl
Georg Brandl added the comment: Alex: IMO the operator support is only required for complex "literals". -- ___ Python tracker ___ ___

[issue13536] ast.literal_eval fails on sets

2011-12-05 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- resolution: -> invalid status: open -> closed superseder: -> ast.literal_eval does not handled new set literals ___ Python tracker ___ ___

[issue13536] ast.literal_eval fails on sets

2011-12-05 Thread Alex Gaynor
Alex Gaynor added the comment: There's no support for comprehensions of any sort, and confusingly limited support for arithmetic ops, I'd like to keep the scope of this issue small, basically backporting 90bf0631bfb8 and adding the tests (which I can also add to default). -- ___

[issue13536] ast.literal_eval fails on sets

2011-12-05 Thread Nick Coghlan
Nick Coghlan added the comment: Dict and Set comprehensions are also broken: >>> {1 for x in ()} set([]) >>> {1:2 for x in ()} {} >>> ast.literal_eval("{1 for x in ()}") Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python2.7/ast.py", line 80, in literal_eval

[issue13536] ast.literal_eval fails on sets

2011-12-05 Thread Brian Curtin
Brian Curtin added the comment: I don't profess to have any special ast knowledge, but given the context around there and the fact that it works...it looks fine to me. -- nosy: +brian.curtin ___ Python tracker __

[issue13536] ast.literal_eval fails on sets

2011-12-05 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +benjamin.peterson, brett.cannon, georg.brandl, ncoghlan ___ Python tracker ___ ___ Python-bugs-l

[issue13536] ast.literal_eval fails on sets

2011-12-05 Thread Alex Gaynor
Alex Gaynor added the comment: Patch with tests -- keywords: +patch Added file: http://bugs.python.org/file23859/x.diff ___ Python tracker ___ __

[issue13536] ast.literal_eval fails on sets

2011-12-05 Thread Alex Gaynor
New submission from Alex Gaynor : In 2.7 ast.literal_eval blows up with a set for input: >>> import ast >>> ast.literal_eval("{1}") -- messages: 148897 nosy: alex priority: low severity: normal status: open title: ast.literal_eval fails on sets versions: Python 2.7 ___