-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
F: parenthesesToo many parentheses, not enough parentheses, and so on.Too many parentheses, not enough parentheses, and so on.S: acceptedThe changes in this design / enhancement issue have been accepted and can be implementedThe changes in this design / enhancement issue have been accepted and can be implementedT: styleWhat do we want Blackened code to look like?What do we want Blackened code to look like?
Description
Remove optional brackets around unpacking
Since #2945, Black removes brackets in the following situation:
for (x, y) in stuff:
...Perhaps this should be extended to include unpacking assignments.
Examples in the current Black style
(x, y) = point
(first, *rest, last) = things
[a, b] = foo # Not touched with for at the momentDesired style
x, y = point
first, *rest, last = things
a, b = foo # Not touched with for at the momentAdditional context
The current style is unstable in situations like the following:
x, y = loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
# Modify
x, y = reallyloooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
# Blacken
(
x,
y,
) = reallyloooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
# Try to revert
(
x,
y,
) = loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
# Blacken (with -C, or remove the trailing comma manually)
(x, y) = loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongfelix-hilden and aaossa
Metadata
Metadata
Assignees
Labels
F: parenthesesToo many parentheses, not enough parentheses, and so on.Too many parentheses, not enough parentheses, and so on.S: acceptedThe changes in this design / enhancement issue have been accepted and can be implementedThe changes in this design / enhancement issue have been accepted and can be implementedT: styleWhat do we want Blackened code to look like?What do we want Blackened code to look like?