]> granicus.if.org Git - python/commitdiff
Update docs about tp_richcompare
authorAndrew Svetlov <andrew.svetlov@gmail.com>
Thu, 3 Jul 2014 13:07:17 +0000 (16:07 +0300)
committerAndrew Svetlov <andrew.svetlov@gmail.com>
Thu, 3 Jul 2014 13:07:17 +0000 (16:07 +0300)
Doc/c-api/typeobj.rst

index 3a647246416ddc103bcaaef1eb470108233f6962..497af23bdfe1ecbb273fa7a6a18d033ca3f6a9ff 100644 (file)
@@ -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