Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unnecessary parentheses in unpacking aren't removed #3080

Open
Akuli opened this issue May 20, 2022 · 2 comments · May be fixed by #3243
Open

unnecessary parentheses in unpacking aren't removed #3080

Akuli opened this issue May 20, 2022 · 2 comments · May be fixed by #3243
Assignees
Labels
F: parentheses Too many parentheses, not enough parentheses, and so on. S: accepted The changes in this design / enhancement issue have been accepted and can be implemented T: style What do we want Blackened code to look like?

Comments

@Akuli
Copy link

Akuli commented May 20, 2022

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 Akuli added the T: style What do we want Blackened code to look like? label May 20, 2022
@felix-hilden felix-hilden added the F: parentheses Too many parentheses, not enough parentheses, and so on. label May 20, 2022
@felix-hilden
Copy link
Collaborator

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

@ichard26 ichard26 added the S: accepted The changes in this design / enhancement issue have been accepted and can be implemented label Aug 1, 2022
@ichard26 ichard26 added this to the Release 22.8.0 milestone Aug 1, 2022
@ichard26
Copy link
Collaborator

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 ichard26 self-assigned this Aug 28, 2022
@ichard26 ichard26 linked a pull request Aug 29, 2022 that will close this issue
3 tasks
@ichard26 ichard26 removed this from the Release 22.9.0 milestone Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: parentheses Too many parentheses, not enough parentheses, and so on. S: accepted The changes in this design / enhancement issue have been accepted and can be implemented T: style What do we want Blackened code to look like?
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants