[New-bugs-announce] [issue31196] Blank line inconsistency between InteractiveConsole and standard interpreter

Malcolm Smith report at bugs.python.org
Sun Aug 13 17:12:37 EDT 2017


New submission from Malcolm Smith:

The standard interpreter is more eager to give an error on incomplete input, while the InteractiveConsole will keep on prompting for more:

Python 3.5.3 (default, Apr 10 2017, 07:53:16)  [GCC 6.3.0 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> try:
...
  File "<stdin>", line 2

    ^
IndentationError: expected an indented block
>>> import code
>>> code.interact()
Python 3.5.3 (default, Apr 10 2017, 07:53:16)  [GCC 6.3.0 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> try:
...
...
...
...

The InteractiveConsole isn't totally wrong here, because after all, a blank line in this position is syntactically correct. But the inconsistency is confusing.

----------
components: Library (Lib)
messages: 300230
nosy: Malcolm Smith
priority: normal
severity: normal
status: open
title: Blank line inconsistency between InteractiveConsole and standard interpreter
type: behavior
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue31196>
_______________________________________


More information about the New-bugs-announce mailing list