Did you actually try Black on a line like this?
left[a_rather_long_key][a_rather_long_key] = right[a_rather_long_key][a_rather_long_key][a_rather_long_key]
Out: left[a_rather_long_key][a_rather_long_key] = right[a_rather_long_key][
a_rather_long_key
][a_rather_long_key]> Black ignores previous formatting and applies uniform horizontal and vertical whitespace to your code.
I now see it does sometimes modify non-whitespace characters e.g. later in the README it mentions:
> In [certain] cases, parentheses are removed when the entire statement fits in one line
I'm not in a position to test black out right now (I can't run Python on the computer I'm posting this comment on). I'd be curious to know what it does on the code I posted, and on over-length comments and string literals.
For your code example, see my comment above.