Issue 8743: Improve interoperability between sets and the collections.Set abstract base class.
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 @@
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: