Describe the style change
I have an assert statement that checks a condition on the last element in an array. To me what black does to the statement makes it less readable:
assert self.ref_transitions[-1].terminal.all(), "Last ref transition must be terminal."
Examples in the current Black style
assert self.ref_transitions[
-1
].terminal.all(), "Last ref transition must be terminal."
Desired style
assert (
self.ref_transitions[-1].terminal.all()
), "Last ref transition must be terminal."
# OR
assert self.ref_transitions[-1].terminal.all(), (
"Last ref transition must be terminal."
)
Additional context
I think operation of taking [-1]th element is best visible with brackets and number grouped. Having to search them across a diagonal on 3 lines is tough.
Describe the style change
I have an assert statement that checks a condition on the last element in an array. To me what black does to the statement makes it less readable:
Examples in the current Black style
Desired style
Additional context
I think operation of taking [-1]th element is best visible with brackets and number grouped. Having to search them across a diagonal on 3 lines is tough.