[issue35494] Inaccurate error message for f-string

Sebastian Linke report at bugs.python.org
Fri Dec 14 09:56:07 EST 2018


Sebastian Linke <Seb_Linke at arcor.de> added the comment:

The same behavior applies to f'{spam[}' and f'{spam(}'. Also to f'{spam{}', but that might be expected.

This message is more clear:
>>> f'{spam('
  File "<stdin>", line 1
SyntaxError: f-string: mismatched '(', '{', or '['

Perhaps you want to apply that to the above error cases. Then you wouldn't have to catch any type of bracket. :-)

----------

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


More information about the Python-bugs-list mailing list