Malcolm Smith <malcolm.sm...@gmail.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31196>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to