Black trims whitespace around walrus operators in slices #3820
Labels
S: accepted
The changes in this design / enhancement issue have been accepted and can be implemented
T: bug
Something isn't working
Describe the bug
Black trims whitespace around
:=
operators within slices. I'm not sure if this is a feature or a bug (if it's intended, feel free to close of course).The behavior is similar to Black's treatment of
:
operators in slices as described here, but I can't tell if the same treatment is intentional for:=
operators.To Reproduce
For example, given this code:
The formatted code is:
Similar to treatment of the
:
operator, Black does not reformat these:Here's a playground link to demonstrate the above cases.
The text was updated successfully, but these errors were encountered: