Terry J. Reedy <[email protected]> added the comment:
#43151 asked about 'is <literal>' syntax warnings in REPL. Discussion noted
that IDLE Shell does note print it for "x is 'a'" (known here) and that for "if
x is 'a': print('executed')" there is a syntax error and no execution. The
conversion to SyntaxError was supposedly fixed by PR-15500, but it appears that
the patch for #40807 introduced it into codeop._maybe_compile.
msg386621 has summary and discussion. I need to add debug prints or
breakpoints into _maybe_compile to understand it better, and maybe improve it.
Before printing syntax warnings in Shell, I want to stop expanding them from 1
to 4 lines. We could just not import the replacement from run.py, but I think
the default format could be improved even with 1 or 2 lines.
----------
title: IDLE: Handle Shell input warnings properly. -> IDLE: Handle Shell input
SyntaxWarning & DeprecationWarning
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37824>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com