Message370751
This is a spinoff of #37824.
My above comments about compile are wrong. The example nests '' within ''. And, with freshly compiled master, I found an example where Deprecation warning, but not SyntaxWarning, accompanies SyntaxError, and which requires trailing \n.
>>> compile("if'\e' is 1: 1", '', 'single')
DeprecationWarning...
SyntaxError: unexpected EOF while parsing
>>> compile("if'\e' is 1: 1\n", '', 'single')
DeprecationWarning...
SyntaxWarning...
<code object ...>
Interactively,
>>> if'\e' is 1: 1
<stdin>:1: DeprecationWarning: invalid escape sequence \e
...
<stdin>:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
>>>
In IDLE, DeprecationWarning is repeated, but that is another issue.
The secondary prompts seems like a bug, The statement is complete and entering anything but a comment is a SyntaxError. (A comment results in another ... prompt.) |
|
Date |
User |
Action |
Args |
2020-06-05 03:01:17 | terry.reedy | set | recipients:
+ terry.reedy, serhiy.storchaka, cheryl.sabella, miss-islington |
2020-06-05 03:01:17 | terry.reedy | set | messageid: <1591326077.08.0.52516771146.issue40807@roundup.psfhosted.org> |
2020-06-05 03:01:17 | terry.reedy | link | issue40807 messages |
2020-06-05 03:01:16 | terry.reedy | create | |
|