By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,525 Members | 1,623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,525 IT Pros & Developers. It's quick & easy.

richcmpfunc semantics

P: n/a
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

Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.