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

Andrew Barnert abarnert at yahoo.com
Fri Mar 20 06:32:20 CET 2015


On Mar 19, 2015, at 10:12 PM, Donald Stufft <donald at stufft.io> wrote:
> 
> 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.

The stdlib is full of milkmen^H^H^H^H^H^H^Hmodules. Some of them are very old. Often older than PEP 8--and presumably the inspiration for PEP 8 to be written in the first place.

At the time PEP 8 was written, obviously nobody went through and rewrote the whole stdlib to be compliant. Why not? Maybe no one volunteered--or maybe someone did, but it was rejected because the costs (risk of introducing new bugs, headaches every time you need to backport a fix across the rewrite, or even just look at the diffs to see what changed when, etc.) outweighed the benefits.

Over time, some parts that touched on the visible interface, that needed to be rewritten anyway, or that are intended to serve as sample code (as in, the source is linked from the docs) have been restyled, but most of the code hasn't. Since most of those updates were in 3.0, and it seems an obvious place for a flag-day restyling if ever there were to be one, I'll bet if you search the py3k archives you'll find some relevant discussions. (Unless Guido or someone else knows off the top of his head.)


More information about the Python-ideas mailing list