From: Gary B. <bur...@ya...> - 2008-05-10 10:59:54
|
>GrampsType also overrides the __cmp__() function. So >in theory, the following should work: > if event_ref.get_role() == >gen.lib.EventRoleType.PRIMARY: >because Python will use the defined __cmp__() >function. But I haven't tried this, myself. I've used this particular construct in various places and can testify that it works fine! I read the underlying classes myself but have to admit that I could not quite understand how this comparison actually works. From Brian's explanation I guess it uses some sort of implicit Python mechanism. Bye Gary __________________________________________________________ Sent from Yahoo! Mail. A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html |