[Python-Dev] Rich Comparison from "C" API?

Tim Peters tim.one@comcast.net
Wed, 12 Jun 2002 11:28:11 -0400


[Tim, claims that PyObject_RichCompareBool isn't documented because
 David hasn't yet submitted a doc patch]

[David Abrahams]
> ...and I didn't volunteer a doc patch yet because the source is too
> complicated to easily determine if it's exactly what I'm looking for.
> Umm, OK, I guess I was looking in the wrong place when poring over the
> implementation of PyObject_RichCompare: ceval.c calls
> PyObject_RichCompare directly. OK, doc patch coming up.

1. You really want PyObject_RichCompareBool in your example, not
   PyObject_RichCompare.  The former is much more efficient in some
   cases (e.g., a total ordering on dicts is much hairer to determine
   than just equality).

2. This is why I keep pulling your leg.  Sometimes you fall for it <wink>.

Thanks for the patch!