Creating a local variable scope.

r0g aioe.org at technicalbloke.com
Thu Dec 3 02:43:29 EST 2009


Ben Finney wrote:
> markolopa <marko.loparic at gmail.com> writes:
> 
>> Hi Roger,
>>
> […]
>>> Long, descriptive variable names all_in_lower_case
>>> Function names all in CamelCase
>>> Global names are in ALL CAPS
>> yes, pep8 I guess.
> 
> Not quite: it deviates from PEP 8 on function names, which should rather
> be ‘lower_case_words_separated_by_underscores’.
> 
> The ‘UPPER_CASE_WORDS_WITH_UNDERSCORES’ form is for “constants”, i.e.
> names that indicate they should stay bound to the same value through the
> life of the program (which is the closest normal Python programs get to
> a “constant” binding).
> 
> The ‘TitleCase’ form should be used only for class names.
> 
> The ‘camelCase’ form is not conformant with PEP 8 at all (which makes me
> glad, since it's hideous).
> 


Heh, see! It's a spiky subject ;) Someday I'm going to found a
substantial open source project just so I can force subsequent
contributors to format their code the way I like it! *bwahahahaaa* :)


Roger.




More information about the Python-list mailing list