[New-bugs-announce] [issue43914] Highlight invalid ranges in SyntaxErrors

Pablo Galindo Salgado report at bugs.python.org
Thu Apr 22 14:08:10 EDT 2021


New submission from Pablo Galindo Salgado <pablogsal at gmail.com>:

To improve the user experience understanding what part of the error messages associated to SyntaxErrors are wrong, we can highlight the whole error range and not only place the caret at the first character. In this way:

>>> foo(x, z for z in range(10), t, w)
  File "<stdin>", line 1
    foo(x, z for z in range(10), t, w)
           ^
SyntaxError: Generator expression must be parenthesized

becomes

>>> foo(x, z for z in range(10), t, w)
  File "<stdin>", line 1
    foo(x, z for z in range(10), t, w)
           ^^^^^^^^^^^^^^^^^^^^
SyntaxError: Generator expression must be parenthesized

----------
messages: 391620
nosy: pablogsal
priority: normal
severity: normal
status: open
title: Highlight invalid ranges in SyntaxErrors

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43914>
_______________________________________


More information about the New-bugs-announce mailing list