diff options
author | Guido van Rossum <guido@python.org> | 2008-01-06 00:09:11 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2008-01-06 00:09:11 (GMT) |
commit | ab078ddb4f8a7ac68f54a3c7f110f4d82e82b16f (patch) | |
tree | 471d852049d8c8525ca9dd6aea46d9e549ce9ea7 /Objects | |
parent | 673f7efa08850e42d077cab38683be2e4764b876 (diff) | |
download | cpython-ab078ddb4f8a7ac68f54a3c7f110f4d82e82b16f.zip cpython-ab078ddb4f8a7ac68f54a3c7f110f4d82e82b16f.tar.gz cpython-ab078ddb4f8a7ac68f54a3c7f110f4d82e82b16f.tar.bz2 |
Issue #1393: object_richcompare() returns NotImplemented instead of
False if the objects aren't equal, to give the other side a chance.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/typeobject.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 982eedb..2a0dd24 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -2484,7 +2484,10 @@ object_richcompare(PyObject *self, PyObject *other, int op) switch (op) { case Py_EQ: - res = (self == other) ? Py_True : Py_False; + /* Return NotImplemented instead of False, so if two + objects are compared, both get a chance at the + comparison. See issue #1393. */ + res = (self == other) ? Py_True : Py_NotImplemented; Py_INCREF(res); break; |