poll: does name conventions in python matters?

vegetax vegeta.z at gmail.com
Tue Apr 19 20:17:23 EDT 2005


Peter Hansen wrote:

> vegetax wrote:
>> in python it is common to see naming
>> inconsistencies ,methods,modules,packages,classes with names in every
>> posible style:
>> thisisalongmethod
>> ThisIsALongMethod
>> thisIsALongMethod
>> this_is_a_long_method
>> and even This_Is_A_Long_Method
>> All over the place,even within one module!
> 
> You certainly won't find most of those in a single
> module, at least not in the standard library. You
> might find a couple.  

there are some of those inconsistent cases in the stdlib,check the sys
module which mixes a_method with amethod all over the place.

> 
> If you are working with new code and need to choose
> something from scratch, go with your personal preference
> and be consistent.
> 
> If all the above fail, use "names_like_this" or
> "namesLikeThis".  If you really need somebody else
> to tell you what to use: use the latter, because
> I told you to. ;-)
> 
> -Peter

Yes sir! =)
I actually follow the scheme you mentioned,the problem lies when you are
using several of this libs in a module and you have to mix all kind of
naming conventions (including yours) which makes the code less readable.






More information about the Python-list mailing list