diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2014-07-03 13:07:17 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2014-07-03 13:07:17 (GMT) |
commit | 0d50af45b654784fe639ab6489f91e7524ed3ace (patch) | |
tree | edfad94589be610005dff60ea852e356bf736abb /Doc | |
parent | 11cda4766108c3220402c5a430573a1288a1b4ac (diff) | |
download | cpython-0d50af45b654784fe639ab6489f91e7524ed3ace.zip cpython-0d50af45b654784fe639ab6489f91e7524ed3ace.tar.gz cpython-0d50af45b654784fe639ab6489f91e7524ed3ace.tar.bz2 |
Update docs about tp_richcompare
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/typeobj.rst | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index 3a64724..497af23 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 |