Is PEP-8 a Code or More of a Guideline?

John J. Lee jjl at pobox.com
Mon May 28 08:40:34 EDT 2007


Paul McGuire <ptmcg at austin.rr.com> writes:
[...]
> http://mail.python.org/pipermail/python-dev/2005-December/058750.html
> 
> At first, Guido seemed ambivalent, and commented on the
> contentiousness of the issue, but it seems that the "non-English
> speakers can more easily find word breaks marked with underscores"
> justification tipped the scale in favor of
> lower_case_with_underscores.
[...]

That rationale seems undermined by the frequent use of runtogether
names in the standard library.  These can be confusing even to native
speakers.  And every time you come up with a new name, or try to
remember an old one, you have to decide or remember whether it's
likethis or like_this.

Even as a native English speaker, some of these are tricky --
e.g. urllib has a private class named "addinfourl".  "What's this
'fourl' we're adding in?"

(In fact, the method adds attributes named "info" and "url".  Even
though I've read that name hundreds of times, my brain always insists
on reading it "add in fourl".)

This is the worst of both worlds: inconsistent and hard to understand.


John



More information about the Python-list mailing list