Message326745
In 3.6.6, """compile("assert (0, 'bad')", '', 'single')""" in Python or IDLE emits "SyntaxWarning: assertion is always true, perhaps remove parentheses?".
In Python,
>>> assert (0, 'bad')
<stdin>:1: SyntaxWarning: assertion is always true, perhaps remove parentheses?
In IDLE's Shell, the same statement is effectively treated as incomplete in that newlines are echoed and IDLE waits for input until something is entered. KeyboardInterrupt (^C) or any text terminate the loop. In the latter case, "SyntaxError: multiple statements found while compiling a single statement" is printed.
In a file, the statement has no effect, but the warning should be printed in the shell. |
|
Date |
User |
Action |
Args |
2018-09-30 20:10:30 | terry.reedy | set | recipients:
+ terry.reedy |
2018-09-30 20:10:30 | terry.reedy | set | messageid: <1538338230.46.0.545547206417.issue34857@psf.upfronthosting.co.za> |
2018-09-30 20:10:30 | terry.reedy | link | issue34857 messages |
2018-09-30 20:10:30 | terry.reedy | create | |
|