-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Black is not removing unnecessary + signs in concatenated strings #2268
Comments
Moreover, as presented in your example, strings on the same line originally are not concatenated either. long_string = "abc" + "def" Now this functionality is not to be expected, but... given that the feature is advertised (and I was the one that wrote the damn paragraph in #2106, sigh 😄), and I can't make it happen with the
Playground, but this works locally as expected with |
Maybe the idea is cool, but it's not something that should be part of Black. AFAIK Black does do not touch the behavior and here we remove the concatenation operation. |
It's fine to do for string literals. The compiler does this already anyway.
|
Agreed. I personally don't think this is something black should do. |
Just to note, this is the polar opposite of #2553. |
Hmm, this isn't necessarily the opposite of #2553. There are a few options that they can co-exist:
Either case, the initial example could still be formatted to |
Describe the bug A clear and concise description of what the bug is.
is formated to
where I would expect:
To Reproduce Steps to reproduce the behavior:
https://black.vercel.app/?version=main&state=_Td6WFoAAATm1rRGAgAhARYAAAB0L-Wj4ADPAHpdAD2IimZxl1N_Wl9XM4Hukmv0lHvH8ZV8H_6vvOURMPls_WzMNcku5-VbAQaYsBSET4vbhPFAzFY5DcRsFuGPJMGD-DLKFHBbxUtuKRJa5J0G0_Yx5DOsXpPSCHuM1nMZEs7HyKRNJp5Z55EyifvKOiVnNdKMFmwsCkKQAAAAd1B6wN16dJoAAZYB0AEAAJ3bnBKxxGf7AgAAAAAEWVo=
Expected behavior A clear and concise description of what you expected to happen.
Environment (please complete the following information):
Does this bug also happen on main? To answer this, you have two options:
yes
The text was updated successfully, but these errors were encountered: