richcmpfunc semantics
- From: harold fellermann <harold.fellermann@xxxxxxx>
- Date: Wed, 6 Apr 2005 20:11:08 +0200
Hi all,
I want to implement rich comparision in an extension class. Problem is I cannot
find good documentation of the richcmpfunc semantics. Given the signature
richcmpfunc compare(PyObject *,PyObject, int);
I supposed the two objects passed are the ones to be compared. What is the meaning of the integer argument? Does it specify the kind of comparision operator (e.g. __eq__ or __le__), and if so, how? What is my richcmpfunc supposed to return? 0 or 1 indicating False or True? What has to be done, if the function is invoked for an operator I don't want to define?
Maybe there is some good documentation available, but I cannot find it. So, any references or help is appreciated.
Cheers,
- harold -
-- "Scientist are very good in answering the questions they choose to answer." -- Richard Alley
.
- Follow-Ups:
- Re: richcmpfunc semantics
- From: Greg Ewing
- Re: richcmpfunc semantics
- Prev by Date: Re: Python Cookbook, 2'nd. Edition is published
- Next by Date: Re: Semi-newbie, rolling my own __deepcopy__
- Previous by thread: Using weakrefs instead of __del__
- Next by thread: Re: richcmpfunc semantics
- Index(es):
Loading