Unnecessary parentheses added to expression in indexed assignment #4349
Labels
F: parentheses
Too many parentheses, not enough parentheses, and so on.
T: bug
Something isn't working
Describe the bug
Black unnecessarily adds parentheses around the right-hand side expression in indexed assignments when breaking lines for long index names. This results in added visual clutter and does not conform to typical Python formatting standards where no additional parentheses would be expected. In particular, PyLint raises the superfluous-parens warning.
To Reproduce
Given the following Python script:
When formatted using the online Black formatter at https://black.vercel.app/?version=main, the assignment line is formatted as follows:
Expected behavior
The expected code should look like this:
Environment
Additional context
None.
The text was updated successfully, but these errors were encountered: