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 terry.reedy
Recipients BTaskaya, gousaiyang, gvanrossum, pablogsal, terry.reedy
Date 2020-10-03.00:25:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The doc for literal_eval says "evaluate ... a string containing a Python literal or container display."  To me, ' 1' qualifies, just as it does as an expression for eval().

The exception comes from parsing raising IndentationError with leading whitespace even when the mode is 'eval' rather than 'exec'.  This surprised me. Eval() gets strips the beginning of the string before it is parsed.  If parsing remains as is, I agree that doing the same for literal_eval strings.  But why should not parsing remove indents for 'eval' mode?
Date User Action Args
2020-10-03 00:25:02terry.reedysetrecipients: + terry.reedy, gvanrossum, pablogsal, BTaskaya, gousaiyang
2020-10-03 00:25:01terry.reedysetmessageid: <>
2020-10-03 00:25:01terry.reedylinkissue41887 messages
2020-10-03 00:25:01terry.reedycreate