yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #12282
Re: [Branch ~yade-pkg/yade/git-trunk] Rev 3709: add function has() to O.interactions to check if (id1, id2) exists + fix doc of O.interactions
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
References