From 0d50af45b654784fe639ab6489f91e7524ed3ace Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Thu, 3 Jul 2014 16:07:17 +0300 Subject: [PATCH] Update docs about tp_richcompare --- Doc/c-api/typeobj.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index 3a647246416..497af23bdfe 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -597,7 +597,9 @@ type objects) *must* have the :attr:`ob_size` field. .. c:member:: richcmpfunc PyTypeObject.tp_richcompare An optional pointer to the rich comparison function, whose signature is - ``PyObject *tp_richcompare(PyObject *a, PyObject *b, int op)``. + ``PyObject *tp_richcompare(PyObject *a, PyObject *b, int op)``. The first + parameter is guaranteed to be an instance of the type that is defined + by :c:type:`PyTypeObject`. The function should return the result of the comparison (usually ``Py_True`` or ``Py_False``). If the comparison is undefined, it must return