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.12:12:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1638360761.77.0.15113673318.issue31196@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-12-01 12:12:41Malcolm Smithsetrecipients: + Malcolm Smith, tomviner, iritkatriel
2021-12-01 12:12:41Malcolm Smithsetmessageid: <1638360761.77.0.15113673318.issue31196@roundup.psfhosted.org>
2021-12-01 12:12:41Malcolm Smithlinkissue31196 messages
2021-12-01 12:12:41Malcolm Smithcreate