Naming conventions

Gordon McMillan gmcm at hypernet.com
Thu Jan 6 14:38:58 EST 2000


Stefan Schwarzer asks:
> 
> are there common naming conventions for Python (functions,
> classes, variables ...)?
> 
> From the code I have seen, I suppose the following naming styles:
> 
> variable   this_is_a_variable
> class      ThisIsAClass (or This_is_a_class?)
> function   this_is_a_funtion
> module     ThisIsAModule, thisisamodule (or what else?)
> 
> Have I forgotten something; do you have more remarks or hints?

The set of naming conventions has a cardinality equal to the 
number of Python users.

Generally agreed:
 class names are Capitalized
 "constants" are ALL_UPPER_CASE

You'll make Windows users lives easier if you use lower case 
for module names.

Any more forceful or extended statement would undoubtedly 
start a religeous war...

only-an-idiot-woud-spell-doThis()-as-do_this()-ly y'rs

- Gordon




More information about the Python-list mailing list