On 31/07/15 09:36, Václav Šmilauer wrote:
>
>> message:
>>    add function has() to O.interactions to check if (id1,id2) exists
>> + fix doc of O.interactions
> You can also call it __contains__
> (https://docs.python.org/2/reference/datamodel.html#object.__contains__),
> and do things like "if (0,1) in ..." v.
Ah... thanks, I was nearly sure there was a way I did not know.
Anyway, it is probably not useless since it is more visible to users
(this is not a theoretical case, someone here was looping on all
interactions just to check if (id1,id2) exists...).
Likewise, I'm thinking engine.__call__() could be without the __***__ in
order to appear in doc and autocompletion. I found it usefull recently.

Bruno



_______________________________________________
Mailing list: https://launchpad.net/~yade-dev
Post to     : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to