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

C Anthony Risinger anthony at xtfx.me
Fri Aug 19 16:24:27 EDT 2016


On Fri, Aug 19, 2016 at 3:11 PM, C Anthony Risinger <anthony at xtfx.me> wrote:
>
>
> When I look at a string I want to immediately know just how literal it
> really is.
>

To further this point, editors today show me \n and \t and friends in a
different color, because they are escapes, and this visually tells me the
thing going into the string at that point is not what is literally in the
code. A raw string does not highlight these because they are no longer
escapes, and what you see is what you get.

Probably f-strings will be used most in short strings, but they'll also be
used for long, heredoc-like triple-quoted strings. It's not going to be fun
picking expressions out of that when the wall-of-text contains no visual
cues.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160819/6fa1af29/attachment.html>


More information about the Python-ideas mailing list