black icon indicating copy to clipboard operation
black copied to clipboard

unnecessary parentheses in unpacking aren't removed

Open Akuli opened this issue 3 years ago • 2 comments

Describe the style change

Replace (foo) with foo when unpacking, where foo is an expression.

Examples in the current Black style

points = [(1, 2), (3, 4)]
for (x), (y) in points:
    print(x, y)

Desired style

points = [(1, 2), (3, 4)]
for x, y in points:
    print(x, y)

Akuli avatar May 20 '22 19:05 Akuli

All for it! Related to #2338 and other similar parens issues.

felix-hilden avatar May 20 '22 19:05 felix-hilden

Hi @jpy-git, I hope you've been doing well.

Given your current open PR (GH-2996) is good to go implementation-wise and is just awaiting a decision on whether the formatting is a good idea or not, I thought it'd be good to give you something to work on (that has been already accepted design-wise) in the meanwhile :) This issue is quite similar to your PR (GH-3080) fixing GH-2338 so it shouldn't be too hard (... hopefully?)

As an alternative I'd suggest working on this issue that's a bit more different than your previous PR: GH-3203.

You don't have to, just if you have the spare cycles and you'd like to do more. Either way, thanks for all of your hard work on black, we appreciate it!

ichard26 avatar Aug 13 '22 23:08 ichard26