This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.smith
Recipients Seaky Lone, eric.smith
Date 2019-08-22.01:11:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1566436272.55.0.574553677964.issue37912@roundup.psfhosted.org>
In-reply-to
Content
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-dev@python.org/message/BDZCXGRW5KTUOGMRT6OHH6S3UD4BV5ZV/ . This post also has an example similar to yours.
History
Date User Action Args
2019-08-22 01:11:12eric.smithsetrecipients: + eric.smith, Seaky Lone
2019-08-22 01:11:12eric.smithsetmessageid: <1566436272.55.0.574553677964.issue37912@roundup.psfhosted.org>
2019-08-22 01:11:12eric.smithlinkissue37912 messages
2019-08-22 01:11:12eric.smithcreate