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 mark.dickinson
Recipients Scott Turner, mark.dickinson, r.david.murray
Date 2015-10-07.18:03:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1444241035.57.0.130625701998.issue25335@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-10-07 18:03:55mark.dickinsonsetrecipients: + mark.dickinson, r.david.murray, Scott Turner
2015-10-07 18:03:55mark.dickinsonsetmessageid: <1444241035.57.0.130625701998.issue25335@psf.upfronthosting.co.za>
2015-10-07 18:03:55mark.dickinsonlinkissue25335 messages
2015-10-07 18:03:55mark.dickinsoncreate