New submission from William Navaraj <[email protected]>:
Currently for non-f-string syntax errors,
the caret points to the correct location of the syntax errors
Example 1:
```
a=foo)+foo()+foo()
```
a=foo)+foo()+foo()
^
SyntaxError: unmatched ')'
For f-string syntax errors,
the caret points two locations after the f-string (almost correct location of
the f-strings as a whole but will be more helpful as much as possible to point
where exactly the syntax error is)
Example 2:
```
temp=f"blank ({foo(}"
```
temp=f"blank ({foo(}"
^
SyntaxError: f-string: closing parenthesis '}' does not match opening
parenthesis '('
Example 3:
```
temp=f"blank ({foo)blank ({foo()}) blank foo()})"
```
temp=f"blank ({foo)blank ({foo()}) blank foo()})"
^
SyntaxError: f-string: unmatched ')'
----------
components: Parser
messages: 409813
nosy: lys.nikolaou, pablogsal, williamnavaraj
priority: normal
severity: normal
status: open
title: caret location for syntax error pointing with f-strings
versions: Python 3.11, Python 3.8
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue46275>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com