mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
[3.12] gh-113445: Amend PyObject_RichCompareBool() docs (GH-113891) (GH-114638)
(cherry picked from commit 926881dc10
)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
This commit is contained in:
parent
bf35ac1d4c
commit
3bf5d90360
1 changed files with 2 additions and 6 deletions
|
@ -172,12 +172,8 @@ Object Protocol
|
||||||
.. c:function:: int PyObject_RichCompareBool(PyObject *o1, PyObject *o2, int opid)
|
.. c:function:: int PyObject_RichCompareBool(PyObject *o1, PyObject *o2, int opid)
|
||||||
|
|
||||||
Compare the values of *o1* and *o2* using the operation specified by *opid*,
|
Compare the values of *o1* and *o2* using the operation specified by *opid*,
|
||||||
which must be one of :c:macro:`Py_LT`, :c:macro:`Py_LE`, :c:macro:`Py_EQ`,
|
like :c:func:`PyObject_RichCompare`, but returns ``-1`` on error, ``0`` if
|
||||||
:c:macro:`Py_NE`, :c:macro:`Py_GT`, or :c:macro:`Py_GE`, corresponding to ``<``,
|
the result is false, ``1`` otherwise.
|
||||||
``<=``, ``==``, ``!=``, ``>``, or ``>=`` respectively. Returns ``-1`` on error,
|
|
||||||
``0`` if the result is false, ``1`` otherwise. This is the equivalent of the
|
|
||||||
Python expression ``o1 op o2``, where ``op`` is the operator corresponding to
|
|
||||||
*opid*.
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool`
|
If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue