[Python-ideas] Adding rule about trailing comma.

Chris Angelico rosuav at gmail.com
Tue Mar 31 10:34:19 CEST 2015


On Tue, Mar 31, 2015 at 7:28 PM, INADA Naoki <songofacandy at gmail.com> wrote:
> Benefit of this style is:
>
> 1) More consistent
> 2) No garbage diff just for just adding comma

So what you have there is a good reason for adopting this style. Is
there strong reason for mentioning it in PEP 8? Remember, every
recommendation in a style guide has a cost - too many rules and it
just becomes onerous, not to mention the increased likelihood of the
rule giving the wrong advice in some corner case (which leads
intelligent people to disregard the rule, and unintelligent checkers
to spew warnings which then have to be ignored - this is one of the
fundamental difficulties of scripting PEP 8 or any other style guide);
ideally, trust people to be intelligent, and don't enforce more than
you have to.

ChrisA


More information about the Python-ideas mailing list