This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Malcolm Smith
Recipients Malcolm Smith, iritkatriel, tomviner
Date 2021-12-01.16:06:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1638374783.99.0.410344175186.issue31196@roundup.psfhosted.org>
In-reply-to
Content
I think it's unlikely that anyone is depending on the ability to enter blank lines in a "try" block in an InteractiveConsole, especially when blank lines terminate the input in almost every other context.

Conversely, everyone who's ever entered a multi-line statement into a Python console knows that blank lines usually terminate the input. And they may have gotten into the habit, as I did, of using a blank line to abandon an incomplete input, and they'll be surprised if it doesn't work in this context. 

On further experimentation, this also affects "def" statements, but only when the blank line is at the start of the block, causing the statement to be syntactically incomplete.

Native interpreter:

    >>> def f():
    ...
      File "<stdin>", line 2

        ^
    IndentationError: expected an indented block after function definition on line 1

InteractiveConsole:

    >>> def f():
    ...
    ...
    ...   pass
    ...
    >>>

So I think the current behavior is likely to annoy a much larger number of people, but whoever's responsible for this part of the standard library will have to judge that for themselves.
History
Date User Action Args
2021-12-01 16:06:24Malcolm Smithsetrecipients: + Malcolm Smith, tomviner, iritkatriel
2021-12-01 16:06:23Malcolm Smithsetmessageid: <1638374783.99.0.410344175186.issue31196@roundup.psfhosted.org>
2021-12-01 16:06:23Malcolm Smithlinkissue31196 messages
2021-12-01 16:06:23Malcolm Smithcreate