-
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
Redundant parentheses around string/int literals #1123
Comments
I tried doing this before the last release but unfortunately it caused some issues, so I had to revert. See #1079. |
Can confirm. Would be really helpful. |
#1132 fixes this for strings, but not the |
Another example (from #1151, a duplicate of this issue): foo(a=1, **{"b": 2} if bar() else {}, c=3)
foo(a=1, **({"b": 2} if bar() else {}), c=3) |
Not fixed for strings yet #2307 |
@Akuli This was fixed by #1132, but this PR has been masked with a feature flag ( Note that there is an effort to eventually enable this feature by default (see #2188) once all of the kinks have been worked out. |
Black could remove redundant parens from keyword arguments
Playground link here
Blackened style
Desired style
I get this a lot when black has reformatted a multi line string which was using implicit concatenation all onto one line. It doesn't actually join the strings (OK, I understand the reason for that) but when you manually delete quotes to join them yourself, you are gonna get redundant parens hanging around.
The text was updated successfully, but these errors were encountered: