We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f68dab commit 2e8f721Copy full SHA for 2e8f721
Objects/setobject.c
@@ -1735,13 +1735,13 @@ set_issubset(PySetObject *so, PyObject *other)
1735
int rv;
1736
1737
if (!PyAnySet_Check(other)) {
1738
- PyObject *tmp, *result;
1739
- tmp = make_new_set(&PySet_Type, other);
1740
- if (tmp == NULL)
+ PyObject *tmp = set_intersection(so, other);
+ if (tmp == NULL) {
1741
return NULL;
1742
- result = set_issubset(so, tmp);
+ }
+ int result = (PySet_GET_SIZE(tmp) == PySet_GET_SIZE(so));
1743
Py_DECREF(tmp);
1744
- return result;
+ return PyBool_FromLong(result);
1745
}
1746
if (PySet_GET_SIZE(so) > PySet_GET_SIZE(other))
1747
Py_RETURN_FALSE;
0 commit comments