Black: README is out of date regarding trailing commas

Created on 30 Oct 2019  路  4Comments  路  Source: psf/black

https://github.com/psf/black/blob/master/README.md#trailing-commas does not seem correct after #826?

documentation trailing comma

Most helpful comment

commas are not removed in function calls any-more

Current Behaviours:

black 19.3b0:

-ham("spam",)
+ham("spam")

black 19.10b0:

ham("spam",)

Is this a bug?

I'd expect either:

explode

-foo("ham",)
+foo(
+    "ham",
+)

or remove trailing commas like 19.3b0

-ham("spam",)
+ham("spam")

All 4 comments

commas are not removed in function calls any-more

Current Behaviours:

black 19.3b0:

-ham("spam",)
+ham("spam")

black 19.10b0:

ham("spam",)

Is this a bug?

I'd expect either:

explode

-foo("ham",)
+foo(
+    "ham",
+)

or remove trailing commas like 19.3b0

-ham("spam",)
+ham("spam")

@pabelanger that's a collection so is behaving differently

Fixed by 6b935a34d08c0b18d858e7da5093dc69a29c55f2, closing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

asottile picture asottile  路  3Comments

brettcannon picture brettcannon  路  3Comments

JelleZijlstra picture JelleZijlstra  路  3Comments

feluxe picture feluxe  路  3Comments

Curly-Mo picture Curly-Mo  路  3Comments