diff options
author | Raymond Hettinger <python@rcn.com> | 2014-05-25 22:13:41 -0700 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2014-05-25 22:13:41 -0700 |
commit | e2cc6f05023af57a3c870293687542f971b3be2d (patch) | |
tree | e6c9675963560806628d1154322be3f2b29438f9 /Objects | |
parent | aceb02f99228bc264095fd5bac4f057f560c30c7 (diff) | |
download | cpython-e2cc6f05023af57a3c870293687542f971b3be2d.tar.gz |
Issue 8743: Improve interoperability between sets and the collections.Set abstract base class.
Diffstat (limited to 'Objects')
-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 db5cee2840..b4b1178021 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: |