On Oct 8, 2008, at 12:15 PM, Aaron DeVore wrote: > I'm writing a class/type that will be inserted into a list. After it > is inserted the developer should be able to call > a_list.index(my_type_instance) and get the my_type_instance index by > *identity*, not by a call to my_type.__eq__. I have a my_type.__eq__ > function but it doesn't give the correct behavior. Which behavior does > Cython use?
I think the issue you're running into is that Python extension classes use rich comparison rather than __eq__ and friends. See http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/version/Doc/ Manual/special_methods.html . - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
