Mark Dickinson added the comment: Digging into the history, it looks as though changeset 884c71cd8dc6 is responsible for the difference between Python 2 and Python 3.
More background: in Python 2, there was the oddity that an expression like `-34` is parsed as a single AST node: in a sense. In Python 3, it's parsed as an unary minus applied to a literal. (So in a sense, Python 2 sorta kinda has negative literals, but Python 3 doesn't.) So the old `ast.literal_eval` stopped working for those negative literals in Python 3. It looks as though Raymond fixed that regression and added support for unary plus at the same time. I'd agree that this isn't a bug in Python 2.7. ---------- nosy: +mark.dickinson _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25335> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com