Message407446
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. |
|
Date |
User |
Action |
Args |
2021-12-01 12:12:41 | Malcolm Smith | set | recipients:
+ Malcolm Smith, tomviner, iritkatriel |
2021-12-01 12:12:41 | Malcolm Smith | set | messageid: <1638360761.77.0.15113673318.issue31196@roundup.psfhosted.org> |
2021-12-01 12:12:41 | Malcolm Smith | link | issue31196 messages |
2021-12-01 12:12:41 | Malcolm Smith | create | |
|