autopep8 seems to be adding newlines to what looks like an expression (but isn't!) inside triple-quoted f-strings.
It does not make the same mistake for triple-quoted non-f-strings, nor for regular-quoted f-strings.
I was originally confused myself, because the {{ ... }} below could be interpreted as a { ... } placeholder containing a literal dict expression, but the PEP seems to say that {{ should always be interpreted as a literal {... which make the characters that follow definitely not a valid expression and so not eligible for newline insertion.
autopep8
seems to be adding newlines to what looks like an expression (but isn't!) inside triple-quoted f-strings.It does not make the same mistake for triple-quoted non-f-strings, nor for regular-quoted f-strings.
I was originally confused myself, because the
{{ ... }}
below could be interpreted as a{ ... }
placeholder containing a literal dict expression, but the PEP seems to say that{{
should always be interpreted as a literal{
... which make the characters that follow definitely not a valid expression and so not eligible for newline insertion.Python Code
No special configuration.
Command Line
It added a newline inside the first triple-quoted f-string literal, but not inside the other ones.
Your Environment
Additional proof
Proof that the reformatting changes the meaning of the string: