Message377843
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:02 | terry.reedy | set | recipients:
+ terry.reedy, gvanrossum, pablogsal, BTaskaya, gousaiyang |
2020-10-03 00:25:01 | terry.reedy | set | messageid: <1601684701.99.0.208243999334.issue41887@roundup.psfhosted.org> |
2020-10-03 00:25:01 | terry.reedy | link | issue41887 messages |
2020-10-03 00:25:01 | terry.reedy | create | |
|