Eric V. Smith <e...@trueblade.com> added the comment:

The lexer sees an f-string:
f'some text {something.split('
next to a normal string:
')}'

The first of those is not a valid f-string because of the unmatched left brace, 
so it's an error.

I'm contemplating making the f-string parser smarter to be able to detect this, 
but it's a long way off.

For an explanation of why it works the way it does currently, see 
https://mail.python.org/archives/list/python-...@python.org/message/BDZCXGRW5KTUOGMRT6OHH6S3UD4BV5ZV/
 . This post also has an example similar to yours.

----------
assignee:  -> eric.smith
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37912>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to