Newbie Question: Naming Conventions

Abe awhite at techtrader.com
Sat Jun 16 03:39:01 EDT 2001


I expect that this is a subject that has been beaten to death, but I
haven't been able to find much info on it:

I've experimented with many many computer languages, and I have to say
that from what I've seen thus far of Python, it is probably the most
elegant I've encountered.  The combination of its clean syntax, OO
nature, and functional aspects is excellent.  HOWEVER, I'm very
frustrated over the apparent lack of stylistic conventions for method
names, etc in an otherwise consistent language.

>From a search of the archives, it appears that Guido's stance on this
is that developers should be free to choose a style that suits them. 
I don't think anyone would disagree with that, but can't we at least
have some consistency for the standard packages and built in
functions?  The recent trend seems to be towards CapitalWords for
classes and alllowercase for methods and packages... but then there
are builtin throwbacks like has_key and raw_input mixed in that stick
out like a sore thumb.

Coming from the java world where the naming style is very consistent,
having to use 'has_key' in the same code block as 'hasattr' drives me
crazy!  I could easily modify the C files to alias the 'haskey' and
'rawinput' names to the correct methods, but then my code wouldn't
work on any other python runtime.

So my question is: is there any proposal to standardize this sort of
thing?  Would such an initiative be welcome in the python community,
or is it seen as not important?  Does anyone see any obvious
compatibility problems with providing an extra 'correct' version of
nonconforming methods and classes until the originals can eventually
be phased out?

Or if this has all been covered before, please let me know where I can
find the relevant discussion.

Thanks!



More information about the Python-list mailing list