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

I agree that both behaviors are reasonable. However, the InteractiveConsole 
documentation says it should "closely emulate the behavior of the interactive 
Python interpreter". Since people are familiar with the native interpreter, any 
difference in behavior is potentially annoying and could throw off somebody's 
flow. So I think the InteractiveConsole should be changed to match the native 
interpreter.

Like the native interpreter, InteractiveConsole allows other multi-line blocks 
to be terminated with a blank line:

>>> def foo(x):
...   pass
...
>>> for x in [1,2,3]:
...   pass
...
>>>


I guess the reason why "try" is different is that a "try" block isn't a 
complete statement on its own. If you follow it with an "except" block, then 
that can indeed be terminated with a blank line.

----------
status: pending -> open

_______________________________________
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