Creating a local variable scope.

Ben Finney ben+python at benfinney.id.au
Tue Dec 1 22:56:14 EST 2009


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).

-- 
 \          “I see little commercial potential for the Internet for at |
  `\                               least ten years.” —Bill Gates, 1994 |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list