Open st-pasha opened 1 year ago
I think a reasonable rule for the assert statement could be something like this:
if an assertion has the form
assert expr1 op expr2
where op
is one of ==
, !=
, is
, is not
, in
, not in
; and the subexpression assert expr1 op
fits inside a line length, then prefer to keep that subexpression unbroken, and apply line-breaking to expr2
only.
if an assertion has the form
assert expression, explanation
where the subexpression assert expression
fits inside a line length, then prefer to keep that subexpression unbroken, and apply line-breaking to explanation
only.
Describe the style change
Strange indentation of a long
assert
statement, in--preview
(it works correctly in the stable branch).Examples in the current (preview) Black style
Desired style
Additional context
Similar to #3409