black
black copied to clipboard
Fix formatting for `if` clauses in `match-case` blocks
Description
Fixes #3793.
Now the if
clauses in the case-match
blocks will be correctly wrapped with parenthesis.
The previous problem of having redundant parentheses being added to case
statement when it's accompanied by an if
clause that was too long, like the example mentioned in #3793 discussion, is also resolved.
Checklist - did you ...
- [x] Add an entry in
CHANGES.md
if necessary? - [x] Add / update tests if necessary?
- [ ] Add new / update outdated documentation?
diff-shades reports zero changes comparing this PR (c87416a736441c015121595f2d7ef9a41dc6ab4d) to main (8332a75e82db143d33f1b873a572bb209675f8a7).