William Navaraj <[email protected]> added the comment:
@Eric Smith,Thanks for explaining the intuition behind this statement. I agree.
Just to avoid ambiguity we could add
"f-string: unmatched '%c' - no matching open parenthesis or missing '}'"
The only possibility at nested_depth==0 line 665 is either of those because of
the check in line 559 i.e. assert(**str == '{')
https://github.com/python/cpython/blob/cae55542d23e606dde9819d5dadd7430085fcc77/Parser/string_parser.c#L559
Will help folks to look backwards (close to open as well) than forwards (open
to close) as in Matt's case which is also a valid interpretation where there is
an opening paren outside the f-string.
or simply
"f-string: unmatched '%c' or missing '}'" will also do.
----------
nosy: +williamnavaraj
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue46260>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com