You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
The text was updated successfully, but these errors were encountered: