New submission from Terry J. Reedy <[email protected]>:
Spinoff from #38673, about standard REPL, msg356271 (me) and msg356348 (Guido).
In the following interactions, no blank lines were entered.
3.9 behavior
>>> #a
>>> # a
>>> #a
>>> # a
>>>
Mystery 1: why the blank continuation line?
I previously wrote
"ast.dump(ast.parse(' # a\n', '', 'single')) gives the same result,
'Module(body=[], type_ignores=[])', as without [space after #]".
Today, 3.8.10, 3.9.5, 3.10, and 3.11 say "unexpected EOF while parsing".
3.10 behavior
>>> #a
...
>>> # a
>>> #a
>>> # a
...
>>>
Mystery 2: why the new continuation line after '#a'?
3.11 behavior
>>> #a
>>> # a
>>> #a
>>> #a
>>> # a
...
>>>
Mystery 3: why does the 3.10 regression for '#a' disappear?
Perhaps IDLE should handle initial blank lines itself, but I will investigate
what codeop._maybe_compile is getting and doing in the different cases first.
----------
messages: 395214
nosy: taleinat, terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: Fix shell comment anomalies
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue44325>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com