-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Formatter: overlong values without breakpoint are never parenthesized #6271
Comments
This behavior isn't just specific to assignments but applies in general (I haven't understood the details yet). I believe this is the relevant logic in black. Where it splits the line by adding optional parentheses, but only keeps them if all lines now fit. I have a branch where I tried to get to the bottom of it but I haven't yet found out the right rules that apply (or messed up the Printer implementation) This is the same as #6059. |
Overlong values in e.g. assignment position without sometimes be parenthesized, this seems to depend on whether parenthesizing actually help too not be overlong anymore. The first step of fixing this issue is figuring out the exact criteria for what is indented and what isn't.
input and our output:
black:
The text was updated successfully, but these errors were encountered: