[Python-checkins] cpython (2.7): Issue #10912: add clarification for PyObject_RichCompareBool comparing

eli.bendersky python-checkins at python.org
Sat Apr 30 07:53:11 CEST 2011


http://hg.python.org/cpython/rev/d27f95e3b52f
changeset:   69703:d27f95e3b52f
branch:      2.7
user:        Eli Bendersky <eliben at gmail.com>
date:        Sat Apr 30 08:51:55 2011 +0300
summary:
  Issue #10912: add clarification for PyObject_RichCompareBool comparing identical objects

files:
  Doc/c-api/object.rst |  3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)


diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst
--- a/Doc/c-api/object.rst
+++ b/Doc/c-api/object.rst
@@ -108,6 +108,9 @@
    Python expression ``o1 op o2``, where ``op`` is the operator corresponding to
    *opid*.
 
+.. note::
+   If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool`
+   will always return ``1`` for :const:`Py_EQ` and ``0`` for :const:`Py_NE`.
 
 .. cfunction:: int PyObject_Cmp(PyObject *o1, PyObject *o2, int *result)
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list