black
black copied to clipboard
Improve `multiline_string_handling` with ternaries and dictionaries
Description
Resolves #4159
As I summarized there, most of the issues described can not be fixed easily. This PR resolves the two problems with obvious fixes: dictionary values with multiline strings should stay parenthesized, and ternaries with multiline strings in the value should stay parenthesized. Again, I don't believe we can do anything for the other pain points mentioned, so this PR resolves the issue as much as possible.
Checklist - did you ...
- [n] Add an entry in
CHANGES.mdif necessary? - [y] Add / update tests if necessary?
- [-] Add new / update outdated documentation?
No idea why Fuzz is failing, I didn't touch anything that should relate to that