Naming conventions (was: Re: refering to base classes)

Jean-Paul Calderone exarkun at divmod.com
Wed Aug 30 00:52:34 EDT 2006


On Wed, 30 Aug 2006 14:22:16 +1000, Ben Finney <bignose+hates-spam at benfinney.id.au> wrote:
>"glenn" <glenn at tangelosoftware.net> writes:
>
>> Bruno Desthuilliers wrote:
>> > It might be better to use newstyle classes if you can. Also, the
>> > convention is to use CamelCase for classes names (unless you have
>> > a strong reason to do otherwise).
>
>Note that this style is more correctly called TitleCase, since the

Or StudlyCaps :)

>first letter of *every* word is capitalised, like in a headline (or
>title). "camel case" is different -- see below.
>
>> ohh - interesting. Thanks for the camelCase tip - dont have a good
>> reason to do otherwise, just bad habits.
>
>The style called camelCase (all words run together, capitalise first
>letter of every word except the first) is prevalent in Java, where it
>denotes the name of an *instance*, in contrast to a *class* which is
>named with TitleCase.
>
>The camelCase style is less popular in the Python world, where (as per
>PEP 8) instances are named with all lower case, either joinedwords or
>separate_by_underscores.

Not that this prevents all projects, even some large ones, from going
with a more camelCased convention.

Jean-Paul



More information about the Python-list mailing list