[Python-ideas] Let’s make escaping in f-literals impossible

Philipp A. flying-sheep at web.de
Tue Aug 30 07:02:25 EDT 2016


Hi Eric,

Very cool of you to get this going!

I hope the outcome is to ban escapes within braced code parts of f-literals
for 3.6 and add them “the right way” in 3.7: f'foo{ bar['\n'] }baz'

It really is how things work in every single language that i ever
encountered that has template literals / string interpolation / f-literals
/ whatchacallit, so in order to be logical and non-surprising, we should do
it that way (eventually).

Also the name “f-strings” is really misleading: They’re composite
expressions that evaluate to strings. They can only be considered
strings if you have no braced code parts in them. So I’m also still in
favor of renaming them (e.g. to “f-literals”).

Best, Philipp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160830/424dee93/attachment.html>


More information about the Python-ideas mailing list