Re: richcmpfunc semantics

2005-04-07 Thread David M. Cooke
harold fellermann <[EMAIL PROTECTED]> writes: > Thank you Greg, > > I figured most of it out in the meantime, myself. I only differ > from you in one point. > >>> What has to be done, if the function is invoked for an operator >>> I don't want to define? >> >> Return Py_NotImplemented. (Note that'

Re: richcmpfunc semantics

2005-04-07 Thread harold fellermann
Thank you Greg, I figured most of it out in the meantime, myself. I only differ from you in one point. What has to be done, if the function is invoked for an operator I don't want to define? Return Py_NotImplemented. (Note that's return, *not* raise.) I used PyErr_BadArgument(); return NULL; instea

Re: richcmpfunc semantics

2005-04-07 Thread Greg Ewing
harold fellermann wrote: richcmpfunc compare(PyObject *,PyObject, int); I supposed the two objects passed are the ones to be compared. Yes. 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? < 0

richcmpfunc semantics

2005-04-06 Thread harold fellermann
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