summaryrefslogtreecommitdiffstats
path: root/Doc/api/abstract.tex
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2002-06-13 11:51:48 (GMT)
committerFred Drake <fdrake@acm.org>2002-06-13 11:51:48 (GMT)
commit178153f8d6f84cadf66e1d313c7b5800e3272fcf (patch)
treeaca6ccf77bd310c549b4529125ca4b7afa38eac7 /Doc/api/abstract.tex
parent2e82e717e666c13aebc063825cebc10af1c684f0 (diff)
downloadcpython-178153f8d6f84cadf66e1d313c7b5800e3272fcf.zip
cpython-178153f8d6f84cadf66e1d313c7b5800e3272fcf.tar.gz
cpython-178153f8d6f84cadf66e1d313c7b5800e3272fcf.tar.bz2
Add documentation for PyObject_RichCompare() and PyObject_RichCompareBool(),
constributed by David Abrahams. This closes SF patch #568081.
Diffstat (limited to 'Doc/api/abstract.tex')
-rw-r--r--Doc/api/abstract.tex42
1 files changed, 42 insertions, 0 deletions
diff --git a/Doc/api/abstract.tex b/Doc/api/abstract.tex
index a7fba71..24de2f1 100644
--- a/Doc/api/abstract.tex
+++ b/Doc/api/abstract.tex
@@ -81,6 +81,48 @@ for which they do not apply, they will raise a Python exception.
\end{cfuncdesc}
+\begin{cfuncdesc}{PyObject*}{PyObject_RichCompare}{PyObject *o1,
+ PyObject *o2, int op}
+ Compare the values of \var{o1} and \var{o2} using the operation
+ specified by \var{op}, which must be one of
+ \constant{Py_LT},
+ \constant{Py_LE},
+ \constant{Py_EQ},
+ \constant{Py_NE},
+ \constant{Py_GT}, or
+ \constant{Py_GE}, corresponding to
+ \code{<},
+ \code{<=},
+ \code{==},
+ \code{!=},
+ \code{>}, or
+ \code{>=} respectively. This is the equivalent of the Python expression
+ \samp{\var{o1} \emph{op} \var{o2}}, where \emph{op} is the operator
+ corresponding to \var{op}. Returns the value of the comparison on
+ success, or \NULL{} on failure.
+\end{cfuncdesc}
+
+\begin{cfuncdesc}{int}{PyObject_RichCompareBool}{PyObject *o1,
+ PyObject *o2, int op}
+ Compare the values of \var{o1} and \var{o2} using the operation
+ specified by \var{op}, which must be one of
+ \constant{Py_LT},
+ \constant{Py_LE},
+ \constant{Py_EQ},
+ \constant{Py_NE},
+ \constant{Py_GT}, or
+ \constant{Py_GE}, corresponding to
+ \code{<},
+ \code{<=},
+ \code{==},
+ \code{!=},
+ \code{>}, or
+ \code{>=} respectively. Returns \code{-1} on error, \code{0} if the
+ result is false, \code{1} otherwise. This is the equivalent of the
+ Python expression \samp{\var{o1} \emph{op} \var{o2}}, where
+ \emph{op} is the operator corresponding to \var{op}.
+\end{cfuncdesc}
+
\begin{cfuncdesc}{int}{PyObject_Cmp}{PyObject *o1, PyObject *o2, int *result}
Compare the values of \var{o1} and \var{o2} using a routine provided
by \var{o1}, if one exists, otherwise with a routine provided by