New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
"EOF in multi-line string" on string containing same quote nested in f-string #4350
Labels
T: bug
Something isn't working
Comments
Feuermurmel
changed the title
"Cannot parse" on string containing same quote nested in f-strings
"EOF in multi-line string" on string containing same quote nested in f-strings
May 5, 2024
Feuermurmel
changed the title
"EOF in multi-line string" on string containing same quote nested in f-strings
"EOF in multi-line string" on string containing same quote nested in f-string
May 5, 2024
I guess it because backslash() aren't allowed in f-string brackets. You can use the double backslash if you want it on the string |
They are allowed since Python 3.12: https://godbolt.org/z/9zGsezrEh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
black
cannot format this type of code:f"{'\''}"
I was thinking that it might be the same bug as #4334, but the example in that issue (
f'{'a'}'
) doesn't produce an error in black 24.4.2 anymore, and Python 3.12.2 accepts the above code:To Reproduce
Playground
Expected behavior
I have no opinion on how this should be formatted. Leaving this code as it is would be fine.
Environment
macOS 12.7.4 (21H1123)
The text was updated successfully, but these errors were encountered: