Message288054
If src is effectively blank, compile(src, filename, mode) raises SyntaxError if mode is 'single' but not if it is 'exec'. I believe IDLE compiles with 'single', but it has the behavior Jim (and I) expect and consider correct, printing '>>>' after effectively blank lines. This is because IDLE uses code.InteractiveInterpreter, which uses codeop.compile_command, which uses codeop._maybe_compile, which replaces effectively blank statements with 'pass'. compile('pass', '', 'single') returns a do-nothing code object. The C-coded interactive interpreter is doing something else. |
|
Date |
User |
Action |
Args |
2017-02-18 02:29:25 | terry.reedy | set | recipients:
+ terry.reedy, eryksun, JDLH |
2017-02-18 02:29:24 | terry.reedy | set | messageid: <1487384964.93.0.458306926892.issue29561@psf.upfronthosting.co.za> |
2017-02-18 02:29:24 | terry.reedy | link | issue29561 messages |
2017-02-18 02:29:24 | terry.reedy | create | |
|