diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/dictobject.c | 2 | ||||
-rw-r--r-- | Objects/setobject.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 9b5898d..773eda0 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -4482,7 +4482,7 @@ _PyDictView_Intersect(PyObject* self, PyObject *other) /* if other is a set and self is smaller than other, reuse set intersection logic */ - if (Py_IS_TYPE(other, &PySet_Type) && len_self <= PyObject_Size(other)) { + if (PySet_CheckExact(other) && len_self <= PyObject_Size(other)) { _Py_IDENTIFIER(intersection); return _PyObject_CallMethodIdObjArgs(other, &PyId_intersection, self, NULL); } diff --git a/Objects/setobject.c b/Objects/setobject.c index 79e8451..bfe6917 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -522,7 +522,7 @@ set_repr(PySetObject *so) goto done; listrepr = tmp; - if (!Py_IS_TYPE(so, &PySet_Type)) + if (!PySet_CheckExact(so)) result = PyUnicode_FromFormat("%s({%U})", Py_TYPE(so)->tp_name, listrepr); |