This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients alex, benjamin.peterson, brett.cannon, brian.curtin, georg.brandl, ncoghlan
Date 2011-12-06.01:29:18
SpamBayes Score 9.781901e-06
Marked as misclassified No
Message-id <1323134960.33.0.679080553573.issue13536@psf.upfronthosting.co.za>
In-reply-to
Content
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 "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/ast.py", line 80, in literal_eval
    return _convert(node_or_string)
  File "/usr/lib64/python2.7/ast.py", line 79, in _convert
    raise ValueError('malformed string')
ValueError: malformed string
>>> ast.literal_eval("{1:2 for x in ()}")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/ast.py", line 80, in literal_eval
    return _convert(node_or_string)
  File "/usr/lib64/python2.7/ast.py", line 79, in _convert
    raise ValueError('malformed string')
ValueError: malformed string
History
Date User Action Args
2011-12-06 01:29:20ncoghlansetrecipients: + ncoghlan, brett.cannon, georg.brandl, benjamin.peterson, alex, brian.curtin
2011-12-06 01:29:20ncoghlansetmessageid: <1323134960.33.0.679080553573.issue13536@psf.upfronthosting.co.za>
2011-12-06 01:29:19ncoghlanlinkissue13536 messages
2011-12-06 01:29:18ncoghlancreate