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

Trailing comma in single element list #1250

Closed
Czaki opened this issue Jan 30, 2020 · 2 comments
Closed

Trailing comma in single element list #1250

Czaki opened this issue Jan 30, 2020 · 2 comments
Labels
T: style What do we want Blackened code to look like?

Comments

@Czaki
Copy link

Czaki commented Jan 30, 2020

Describe the style change Not add trailing comma in single element list

Examples in the current Black style Think of some short code snippets that show
how the current Black style is not great:

    def get_getter_and_setter_function(
        widget: QWidget,
    ) -> typing.Tuple[typing.Callable[[QWidget,], typing.Any], typing.Callable[[QWidget, typing.Any], None]]:
    pass

Desired style How do you think Black should format the above snippets:

    def get_getter_and_setter_function(
        widget: QWidget,
    ) -> typing.Tuple[typing.Callable[[QWidget], typing.Any], typing.Callable[[QWidget, typing.Any], None]]:
    pass

Additional context If someone would like to see wfole code context it si here

@Czaki Czaki added the T: style What do we want Blackened code to look like? label Jan 30, 2020
@ndwhelan
Copy link

ndwhelan commented Feb 5, 2020

The desired functionality was apparently removed after 18.9b0. I'm curious if this was intentional? My main concern is that it breaks flake8 compatibility, when using the flake8 config recommended by black.

Maybe a duplicate of #1202?

@zsol
Copy link
Collaborator

zsol commented Feb 6, 2020

Correct, this is a duplicate of #1202

@zsol zsol closed this as completed Feb 6, 2020
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

No branches or pull requests

3 participants