[Python-3000] Will standard library modules comply with PEP 8?

john.m.camara at comcast.net john.m.camara at comcast.net
Tue Aug 28 00:16:51 CEST 2007


> Message: 10
> Date: Mon, 27 Aug 2007 13:05:13 -0700
> From: "Guido van Rossum" <guido at python.org>
> Subject: Re: [Python-3000] Will standard library modules comply with
> 	PEP 8?
> To: "Christian Heimes" <lists at cheimes.de>
> Cc: python-3000 at python.org
> Message-ID:
> 	<ca471dc20708271305u6961c69h2ffd97c54e2fe613 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
On 8/27/07, "Guido van Rossum" <guido at python.org> wrote:
> On 8/27/07, Christian Heimes <lists at cheimes.de> wrote:
> > Dennis Brakhane wrote:
> > > I'd like to ask if the modules in the standard library will comply
> > > with PEP 8. I've always found it weird that - in the logging module,
> > > for example - I have to get the logger via getLogger instead of
> > > get_logger. I understand that the logging module is older than PEP 8
> > > and therefore couldn't be changed. So if there's a time to "fix"
> > > logging, it'd probably be now.
> >
> > If I were in the position to decide I would rather change the PEP than
> > the logging module. I prefer Zope 3 style camel case names for public
> > attributes and methods
> > (http://wiki.zope.org/zope3/ZopePythonNamingConventions point 3) over
> > underscore names. I like to see the camel case style for public names as
> > an alternative in PEP 8. I find it easier to read and less to type. But
> > again it is just my personal and subjective opinion.
> 
> Let's not start another bikeshed color debate. The PEP has been
> discussed, discussed again, and accepted.
> 
Not trying to continue the bikeshed debate but just pointing out an area in PEP 8 which could be improved.

I would like to see PEP 8 remove the "as necessary to improve readability" in the function and method naming conventions.  That way methods like StringIO.getvalue() can be renamed to StringIO.get_value().

from PEP 8

      Function Names

            Function names should be lowercase, with words separated by underscores
            as necessary to improve readability.

            ...

      Method Names and Instance Variables

            Use the function naming rules: lowercase with words separated by
            underscores as necessary to improve readability.

            ...

John


More information about the Python-3000 mailing list