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

David Mertz mertz at gnosis.cx
Fri Aug 19 16:39:02 EDT 2016


I don't think I've ever used a syntax highlighter than changed color of \n
in a string. I get the concept, but I haven't suffered for the absence of
that.

Moreover, although I haven't yet used them, I really doubt I want extra
syntax highlighting in f-strings beyond simply the color strings appear as.
Well, maybe a uniform distinction for f-string vs. some other kind of
string, but nothing internal to the string.

YMMV, but that would be my preference in my text editor. Curly braces are
perfectly good visual distinction to me.

On Aug 19, 2016 1:25 PM, "C Anthony Risinger" <anthony at xtfx.me> wrote:

> 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.
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160819/fbf5f587/attachment.html>


More information about the Python-ideas mailing list