Closed PaulMcMillan closed 12 years ago
In fact, it seems to correct these instances in the wrong direction such that pep8 complains about them.
I'd sorta lean towards the correction being to remove the trailing comma in the list, since the alternative of [1,2, ]
is pretty ugly too. On the other hand, lists that have the closing ]
on a separate line benefit from the trailing comma, so...
I think that however lists are handled should be the same as how tuples are handled. Removing the trailing comma creates an issue for (1,)
so it seem that (1, )
is a better solution. That seems fairly ugly to me, but I strongly want to keep compatibility with pep8.
It actually looks like pep8 does not complain about (1, 2,)
which seems like a bug on their part. The edge-case code for single element tuples is probably allowing too much.
pep8 complains about code with a trailing
,
in a list like so:test.py:1:9: E231 missing whitespace after ','
pep8ify doesn't fix this.