[Python-Dev] Changes to PEP 327: Decimal data type (original) (raw)

Barry Warsaw barry at python.org
Thu Mar 18 10:48:00 EST 2004


On Thu, 2004-03-18 at 10:18, Shane Hathaway wrote:

Tim Peters wrote: > More importantly, lowernames are correct. This gets confused in PythonLand > because some major contributors (like Zope Corp) have institutionalized > aWrongPolicy for naming methods. If you don't believe me, ask Barry. I > believe him on this issue because he just can't be wrong about everything > .

Since most of my Python work has been on Zope, I didn't notice Python has this naming convention until this thread. I've read PEP 8 several times, but the "method names" section only says to use lowercase. It doesn't say what to do if the method name requires multiple words. This is left to interpretation by the reader, and I've always interpreted it as meaning mixedCase. People who come to Python through Zope tend to guess that Python uses the same naming conventions as Java. I suggest the "method names" section needs to be more specific to correct this misunderstanding. Perhaps: "Use lowercasewithunderscores for all method names. Single-word method names are preferred." It might also say that not all of the Python library follows this convention, but all new modules will.

I've gone back and forth on this issue several times, but the rationale that Tim refers to has to do with conversations we've had on various lists, and the decision we made with the email package. At the time, lowercase_with_underscores was preferred by non-native English speakers over mixedCaseWords. It seems that the latter can give non-native English speakers more difficulty.

Sometimes though, I still like mixedCase. ;)

+1 on updating PEP 8 to encourage lowercase_with_underscores.

-Barry



More information about the Python-Dev mailing list