Sreeram Kandallu wrote: > I'm writing an extension type, for which i'd like to implement only == > and !=, but not the other comparison operators like <,<=,>,>=. > What is the right way to do this? > I currently have a tp_richcompare function, which handles Py_EQ, and > Py_NE, but raises a TypeError for the other operations. Is this the > 'right' way?
Yes. This is exactly what the builtin complex type does. > Sreeram > Ziga -- http://mail.python.org/mailman/listinfo/python-list