[Python-Dev] PEP 8 updates/clarifications, function/method style (original) (raw)

Barry Warsaw barry at python.org
Wed Dec 14 21:13:24 CET 2005


On Wed, 2005-12-14 at 10:17 -0800, Guido van Rossum wrote:

Actually this (function, method and ivar names) is such a contentious issue that I think the style guide should explicitly allow all two/three styles and recommend to be consistent within a class, module or package.

My own feeling is that the PEP should keep its current recommendation of lower_case_words. It allows for the other styles under the "be internally consistent" guideline.

My current rewrite (to be checked in soon), has this also to say:

  mixedCase is allowed only in contexts where that's already the
  prevailing style (e.g. threading.py), to retain backwards compatibility.

It could be argued that this guideline should be relaxed to give lower_case_words and mixedCase equal footing. I'd disagree, but will make that change to the PEP if there's strong consensus in favor of taking that position.

I want to be adamant about module, package and class names though: module/package names should be short all-lowercase without underscores; class names should be CapWords. I'd like to fix this for StringIO.py, UserDict.py etc.

Absolutely.

> The use of lowercase with underscores is the default so > the python std lib should use it in all modules.

Too late. I don't think the diversity is all that distracting. I'd be much more concerned about spelling MethodNames (as unfortunately the Google style guide requires).

That's right out. :)

-Barry

-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 307 bytes Desc: This is a digitally signed message part Url : http://mail.python.org/pipermail/python-dev/attachments/20051214/f05c2db3/attachment.pgp



More information about the Python-Dev mailing list