summaryrefslogtreecommitdiffstats
path: root/Objects/dictobject.c
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2021-02-20 18:03:08 (GMT)
committerGitHub <noreply@github.com>2021-02-20 18:03:08 (GMT)
commitd439fb304ca3098aab1ed0a314996f9d29347b21 (patch)
tree10d231bac1b2f609a1179cbe8e6e06610080feb0 /Objects/dictobject.c
parent46496f9d12582bf11f4911ad0f23315d6f277907 (diff)
downloadcpython-d439fb304ca3098aab1ed0a314996f9d29347b21.zip
cpython-d439fb304ca3098aab1ed0a314996f9d29347b21.tar.gz
cpython-d439fb304ca3098aab1ed0a314996f9d29347b21.tar.bz2
bpo-43277: Add PySet_CheckExact to the C-API (GH-24598)
For some mysterious reason we have PySet_Check, PyFrozenSet_Check, PyAnySet_Check, PyAnySet_CheckExact and PyFrozenSet_CheckExact but no PySet_CheckExact.
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r--Objects/dictobject.c2
1 files changed, 1 insertions, 1 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);
}