Message372134
It's relatively easy to identify if a SyntaxError occurs when parsing an fstring expression or not. The idea is to slightly change the error message to start with "f-string: " when it does (in the same way in which SyntaxError messages are produced by the hand-written fstring parser). I have a working PR that produces the following:
$ cat a.py
f'{a $ b}'
$ ./python.exe a.py
File "/Users/lysnikolaou/Repositories/cpython/a.py", line 1
(a $ b)
^
SyntaxError: f-string: invalid syntax
Thoughts? |
|
Date |
User |
Action |
Args |
2020-06-22 23:53:42 | lys.nikolaou | set | recipients:
+ lys.nikolaou, gvanrossum, eric.smith, pablogsal |
2020-06-22 23:53:42 | lys.nikolaou | set | messageid: <1592870022.32.0.609883413471.issue41084@roundup.psfhosted.org> |
2020-06-22 23:53:42 | lys.nikolaou | link | issue41084 messages |
2020-06-22 23:53:42 | lys.nikolaou | create | |
|