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

Black should remove unnecessary outer parentheses around function arguments #548

Closed
jdufresne opened this issue Oct 2, 2018 · 4 comments · Fixed by #850
Closed

Black should remove unnecessary outer parentheses around function arguments #548

jdufresne opened this issue Oct 2, 2018 · 4 comments · Fixed by #850
Labels
T: style What do we want Blackened code to look like?

Comments

@jdufresne
Copy link
Contributor

Operating system: Fedora release 27
Python version: Python 3.6.6
Black version: 18.9b0
Does also happen on master: Yes

Input:

print((1))

Expected change:

print(1)

Actual: file left unchanged

@rooterkyberian
Copy link

print(((1))) will also be unchanged where we expected it to be equal to print(1)

Something that is likely another issue, but similar:

f = lambda a: (1)
g = lambda a: ((1))

will also be left unchanged

tested with
Python version: Python 3.7.0
Black version: 18.9b0

@sr105
Copy link

sr105 commented Apr 25, 2019

Duplicate of #445

@JelleZijlstra
Copy link
Collaborator

Don't think this is quite a dupe.

@JelleZijlstra JelleZijlstra added the T: style What do we want Blackened code to look like? label May 5, 2019
@sr105
Copy link

sr105 commented May 6, 2019

Both involve black removing unnecessary tuple parentheses. The code to fix one will likely fix the other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: style What do we want Blackened code to look like?
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants