diff options
author | Raymond Hettinger <python@rcn.com> | 2014-05-26 05:13:41 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2014-05-26 05:13:41 (GMT) |
commit | f643b9a9c79928c4ca28d895e7e9a1dcf827cf00 (patch) | |
tree | 52e182eb59f1caf8b7b59e3812ebcae56d70350d /Objects/setobject.c | |
parent | 92df7529cb6c863d0fcd3247829b24833f62e285 (diff) | |
download | cpython-f643b9a9c79928c4ca28d895e7e9a1dcf827cf00.zip cpython-f643b9a9c79928c4ca28d895e7e9a1dcf827cf00.tar.gz cpython-f643b9a9c79928c4ca28d895e7e9a1dcf827cf00.tar.bz2 |
Issue 8743: Improve interoperability between sets and the collections.Set abstract base class.
Diffstat (limited to 'Objects/setobject.c')
-rw-r--r-- | Objects/setobject.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c index db5cee2..b4b1178 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -1796,12 +1796,8 @@ set_richcompare(PySetObject *v, PyObject *w, int op) PyObject *r1, *r2; if(!PyAnySet_Check(w)) { - if (op == Py_EQ) - Py_RETURN_FALSE; - if (op == Py_NE) - Py_RETURN_TRUE; - PyErr_SetString(PyExc_TypeError, "can only compare to a set"); - return NULL; + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; } switch (op) { case Py_EQ: |