[Python-ideas] gofmt for Python: standardized styling as a language feature

Donald Stufft donald at stufft.io
Fri Mar 20 16:50:44 CET 2015


> On Mar 20, 2015, at 2:06 AM, Stephen J. Turnbull <stephen at xemacs.org> wrote:
> 
> Donald Stufft writes:
> 
>> Working on the Python stdlib is somewhat frustrating to me in this
>> regard because the code in the stdlib is often times wildly
>> inconsistent even within the same module.
> 
> Maybe you haven't paid attention to past discussions, but the Python
> stdlib is a terrible example because fixing it up is a FAQ on this
> list, on core-mentoriship, and (in the past) on python-dev.  It has
> been repeatedly vetoed on the grounds that changes, even in
> whitespace, are likely to introduce more bugs than consistent style is
> worth.
> 
> If you're actually working *on* the stdlib, then improve the style as
> you fix bugs or add features.  If you are working on something that
> requires studying the stdlib, then you're out of luck.
> 
> None of the above means that improving the stdlib's coding style is
> off the table as far as I'm concerned.  I personally wouldn't mind
> seeing it happen, but I don't care that much.
> 
> What it means is simply that the stdlib is the worst possible example
> to make your case -- everybody agrees with you about the inconsistent
> style, but Those Who Make Decisions Around Here think there are more
> important considerations than style.
> 
>> I was merely offering my experience that *anything* which relies on
>> a human to verify it is, without exception, going to be verified
>> unevenly and that using a human to verify it invites people to
>> attempt to argue against it more often than when a machine does it.
> 
> But the stdlib is a terrible example for that purpose for the same
> reason.
> 
> But I take your point that using a machine can smooth correction of
> "mechanical" errors.  Mine is simply that I don't see that it makes
> such a big difference in my experience; most people who have horrible
> coding styles respond to human advice quite well, and the "minor"
> differences are -- minor.
> 
> YMMV.
> 

I used the stdlib primarily because it was an agreed upon fact that
the style there was inconsistent. However it’s not just in old
modules, it’s in any module that has had more than a handful of
contributors to it. I was picking on the stdlib to avoid calling out
other people’s software where it wasn’t an agreed upon thing that
it was bad.

If you want non stdlib examples, pip itself and virtualenv are both
great (terrible?) examples of wildly inconsistent style. Pip is better
now because we went through and fixed it all and are now running
automated style checks as part of our CI.

---
Donald Stufft
PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150320/5b0c43b2/attachment.sig>


More information about the Python-ideas mailing list