pycodestyle icon indicating copy to clipboard operation
pycodestyle copied to clipboard

Prevent confusion with unintentional traling commas

Open kmmbvnr opened this issue 8 years ago • 8 comments

There is the common programmer mistake to leave a trailing comma on a value, that leads that value unexpectedly treated as a tuple [1] [2]

PEP8 guide already warn on this https://www.python.org/dev/peps/pep-0008/#when-to-use-trailing-commas

Yes:

FILES = ('setup.cfg',)
OK, but confusing:

FILES = 'setup.cfg',

What you think about to allow pycodestyle tool to produce a warning message in that case?

Pylint has that check since 1.7 version

kmmbvnr avatar Oct 13 '17 10:10 kmmbvnr