method's names

Oleg G. Sharov o.sharov at gmail.com
Tue Nov 7 09:49:11 PST 2006


Здравствуйте, Vlad.

Вы писали 7 ноября 2006 г., 1:44:35:

> Oleg G. Sharov wrote:

>>I have reviewed code of new classes (Database, WorkingCopy, LocalModsArea)
>>Vlad, Why didn't you use verbs in some method's names?
>>LocalModsArea.comments
>>LocalModsArea.issues
>>
>>I prefer such names
>>LocalModsArea.get_comments
>>LocalModsArea.get_issues
>>
>>May be you should change names. What do you think?
>>  
>>

> These methods are the need of iteration over issues/comments and so a 
> construct like this:

> for name, issue in db.issues():
>     do something

> is read more like natural English and is also more "pythonic" (compare:
> for x in dict.keys() / dict.values() / ...).

> Makes sense?

Ok, I agree with you. I haven't considered methods from that standpoint.

-- 
Oleg G. Sharov, o.sharov at gmail.com, http://gg.ulstu.ru



More information about the Dev mailing list