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 Anselm Kiefner, eric.smith
Date 2017-06-28.22:43:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1498689833.87.0.558717330579.issue30793@psf.upfronthosting.co.za>
In-reply-to
Content
The reason that this was done was to give us flexibility in deciding how the backslashes should be interpreted in the future. I announced it on python-dev here: https://mail.python.org/pipermail/python-dev/2016-August/145979.html. That message contains a link to the python-ideas discussion that precipitated the change.

PEP 536 is one proposal to change how this is handled. I don't entirely agree with it, since I think allowing:
f'Magic wand: { bag['wand'] }'
would be confusing and make life more difficult for simple (regex based) parsers to skip over f-strings.

Notice that in Jupiter (https://github.com/jupyter/notebook/issues/2037#issuecomment-272466046) and in CodeMirror (https://github.com/codemirror/CodeMirror/commit/c45674b11e990fe37abc662b0c507d3bb1f635e7#diff-04f7f1f1bbbab888742c7e849187a79c) they were able to make simple changes to their parsers and "support" f-strings (for some value of "support": mostly not break in the presence of f-strings).

However, I'm not completely opposed to revisiting the issue. Your use case is certainly a compelling one.
History
Date User Action Args
2017-06-28 22:43:53eric.smithsetrecipients: + eric.smith, Anselm Kiefner
2017-06-28 22:43:53eric.smithsetmessageid: <1498689833.87.0.558717330579.issue30793@psf.upfronthosting.co.za>
2017-06-28 22:43:53eric.smithlinkissue30793 messages
2017-06-28 22:43:53eric.smithcreate