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 <1601684701.99.0.208243999334.issue41887@roundup.psfhosted.org>
In-reply-to
Content
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?
History
Date User Action Args
2020-10-03 00:25:02terry.reedysetrecipients: + terry.reedy, gvanrossum, pablogsal, BTaskaya, gousaiyang
2020-10-03 00:25:01terry.reedysetmessageid: <1601684701.99.0.208243999334.issue41887@roundup.psfhosted.org>
2020-10-03 00:25:01terry.reedylinkissue41887 messages
2020-10-03 00:25:01terry.reedycreate