[Python-ideas] Evolution of Style Guides

Andrew Barnert abarnert at yahoo.com
Wed Mar 18 09:48:29 CET 2015


On Mar 18, 2015, at 12:30 AM, Florian Bruhin <me at the-compiler.org> wrote:
> 
> * Andrew Barnert <abarnert at yahoo.com.dmarc.invalid> [2015-03-18 00:18:02 -0700]:
>>> On Mar 17, 2015, at 11:33 PM, Ian Lee <ianlee1521 at gmail.com> wrote:
>>> 
>>> 
>>> * There are a number of checks that are disabled in pep8 by default, due to their being somewhat controversial for many users [5] which you can read about what each of them are for in the docs [6] if you're interested.
>> 
>> I don't know that the rules themselves are necessarily controversial, so much as the way the checks are implemented.
>> 
>> I enabled E226 to see what it does (just because it sounded like the easiest one to test without reading further).
>> 
>> It flags the "Yes" examples from the PEP ("c = (a+b) * (a-b)")
>> as an error, and passes the corresponding "No" examples ("c = (a + b) * (a - b)"). No wonder it's controversial.
>> 
>> What's going on? The rule it enforces is "always put whitespace around arithmetic operators", but the rule in the PEP is "If operators with different priorities are used, consider adding whitespace around the operators with the lowest priority(ies)."
> 
> That was an addition made "recently" to pep8:
> https://hg.python.org/peps/diff/37af28ad2972/pep-0008.txt
> 
> I guess pep8 adopted by disabling that check by default, rather than
> completely removing it.

So PEP 8 evolved to match changing community standards, maybe even in part because of community experience with the pep8 tool, and the tool adapted to those changes... So what needs to change here?

(If Ian was arguing that pep8, autopep8, etc. should remain outside the stdlib so they can continue to adapt at a reasonable pace, then I think I agree, but I think he was suggesting something different; I'll go re-read the post, and apologies in advance if I'm wrong.)


More information about the Python-ideas mailing list