[Python-ideas] Evolution of Style Guides
Ian Lee
ianlee1521 at gmail.com
Wed Mar 18 07:33:32 CET 2015
tl;dr -- How should style guides evolve?
So this is a post inspired largely by a thread that popped up today [1],
and specifically Alex's message [2]. I didn't want to derail that
conversation (specifically dealing with style checking / correcting as a
part of the standard library), but I did want to start a separate thread
for an idea that's been rattling around in my brain for a while now.
(Disclaimer, I am the current lead maintainer of the pep8 package, so part
of this comes from my work there.)
Namely, how should style guides, and here I'm particularly looking at
PEP-8, evolve?
I was influenced early on in my Python learning by a number of youtube
Python conference talks. In particular "A Python Æsthetic: Beauty and Why
I Python" by Brandon Rhodes [3] and "Transforming Code into Beautiful,
Idiomatic Python" by Raymond Hettinger [4] had quite an impact on my
thinking while I was moving from C / C++ to Python a couple of years back,
and I highly recommend them.
Somewhat of an open question, I'm not sure I have a particularly hard and
fast opinion on this issue, and I'd love to get feedback from the
community. In particular, a couple of points that are worth mentioning:
* 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.
* Even within the checker community, there is some discussion about whether
the tool should be rigidly set by the PEP-8 document (I tend to think it
should be) and what that means for folks that don't want to follow a rule
(I just disable it in my code) (see discussion about the use of
``isinstance()`` at [7]).
* There are several large code bases, the Python stdlib and Twisted for
starters, that don't necessarily follow PEP-8 to the letter, due to
pre-dating PEP-8 or being highly specialized, or etc, and proposals to
bring them more in line have received pushback over their potential for
more harm than good (see [8] for an example) (which is completely valid).
[1] https://mail.python.org/pipermail/python-ideas/2015-March/032545.html
[2] https://mail.python.org/pipermail/python-ideas/2015-March/032556.html
[3] https://www.youtube.com/watch?v=x-kB2o8sd5c
[4] https://www.youtube.com/watch?v=OSGv2VnC0go
[5] https://github.com/jcrocholl/pep8/blob/master/pep8.py#L68
[6] http://pep8.readthedocs.org/en/latest/intro.html#error-codes
[7] https://github.com/jcrocholl/pep8/pull/313
[8] http://bugs.python.org/issue23061#msg233065
~ Ian Lee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150317/43a7fee6/attachment.html>
More information about the Python-ideas
mailing list