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

David Abrahams David Abrahams" <david.abrahams@rcn.com
Wed, 12 Jun 2002 11:13:25 -0400


----- Original Message -----
From: "Tim Peters" <tim.one@comcast.net>
To: "David Abrahams" <david.abrahams@rcn.com>
Cc: <python-dev@python.org>
Sent: Wednesday, June 12, 2002 11:02 AM
Subject: RE: [Python-Dev] Rich Comparison from "C" API?


> [David Abrahams]
> > Suppose I want to execute, from "C", the same steps taken by Python in
> > evaluating the expression
> >
> >     x <= y
> >
> > I see no documented "C" API function which can do that. I'm guessing
> > PyObject_RichCompare[Bool] may do what I want, but since it's
> > undocumented I assume its untouchable. Guido?
>
> It doesn't start with an underscore, and is advertised in object.h, so
that
> it's undocumented just means you didn't yet volunteer a doc patch <wink>.

...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.

-Dave