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
Black should prefer line-breaking at binary operators over function parentheses or index/slice parentheses of one of the expression's elements. Especially in multi-element expression (e.g. calculations), the code becomes hard to read.
I have even seen worse examples than the two below, where a calculation becomes impossible to follow. But I think these two examples are quite clear.
Both of your examples increase vertical space use. Black prefers to split by operator if there's more than one, otherwise it leads to a myriad of pathological cases. We've tried always splitting on operators, it's less code actually. But testing with large bodies of source code, this wound up being worse on average.
I'm not closing this yet as I do feel we have tackle this somehow.
This is similar to other issues like #571, #587, #1050 and #1094.
Black should prefer line-breaking at binary operators over function parentheses or index/slice parentheses of one of the expression's elements. Especially in multi-element expression (e.g. calculations), the code becomes hard to read.
I have even seen worse examples than the two below, where a calculation becomes impossible to follow. But I think these two examples are quite clear.
Examples in the current Black style
Desired style How do you think Black should format the above snippets:
The text was updated successfully, but these errors were encountered: