black
black copied to clipboard
Change the formatting behaviour when there is bracket in the if statement, like a list, a function
The problem
I'm always frustrated when formatting for a long if statement that involved in. So the if statement shall break with the "and", "or" keyword normally. However, if it is like a "key" in [array_item1, array_item2... ], it will break from the list and create a inconsistent layout with other if.
please think of every variable is with very long name if a=b and c=d: normally change to if ( a=b and c=d ):
but if a=b and c in [d, e, f]: it will change to if a=b and c in [d, e, f]:
Solution that I want to have I hope that it will behave like other situation and become if a=b and c in [d, e, f]:
i can correct it down, should i enhance it and give myself PR??