hi, i already posted in python-ideas, but i got no replies, so i’ll post here:
in essence i think interpreting escape sequences in f-literals is a *very* bad idea, mainly because i think it’s fundamental that syntax highlighters can highlight code as code.
so they should highlight the code parts of f-literals as code to avoid bugs and misunderstandings (parts highlighted as string aren’t expected to execute). for many syntax highlighters, it’s *impossible* to properly highlight python code after this change makes python’s grammar recursive (escaped code in f-literals, doubly-escaped code in escaped f-literals in f-literals, …).
i want this changed because i think it’s only done this way to reuse the string tokenization code (i.e. convenience), not for some deeper reason. the RFC even says so. however, f-literals aren’t strings, but expressions, so string tokenization rules shouldn’t apply to the non-string parts.