tp_richcompare

Sreeram Kandallu sreeram at tachyontech.net
Fri Jun 2 02:28:07 EDT 2006


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?

Sreeram

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20060602/c19c9de7/attachment.sig>


More information about the Python-list mailing list