[Python-Dev] pep8 reasoning
Chris Withers
chris at simplistix.co.uk
Thu Apr 24 09:18:22 CEST 2014
Hi All,
Apologies if this is considered off topic, but I'm keen to get the
"language designers" point of view and short of emailing Barry, Guido
and Nick directly, this seemed like the best place.
I'm having a tough time persuading some people of the benefits of pep8,
particularly when it comes to applying to an existing large code base.
The biggest sticking point is naming, particularly as it's the one thing
that can't necessarily be changed module by module. What were the
compelling reasons to go from mixedCase to underscore_separated? What's
considered the best approach for migrating from the former to the latter?
A couple of others that have raised some consternation; what are the
technical reasons for this pattern being bad:
if len(seq)
if not len(seq)
...or, for me, the rather ugly:
if 0 != len(seq)
Likewise, these:
if greeting == True:
if greeting is True:
Please don't misunderstand me: I dislike the above intensely, but it's
an emotional response based on 10-15 years of doing things the other
way. I'm interested in arguments that don't include things like "it's
pythonic" (which some people consider a derogatory term ;-)), or "just
because", I trust that the stuff in pep8 was done with specific
reasoning in mind, but I'm feeling rather useless at giving that
reasoning and I'm hoping you can help :-)
cheers,
Chris
More information about the Python-Dev
mailing list