summaryrefslogtreecommitdiffstats
path: root/Objects/dictobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r--Objects/dictobject.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 8f6ce39..86ac4ef 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -608,7 +608,7 @@ new_dict(PyDictKeysObject *keys, PyObject **values)
if (numfree) {
mp = free_list[--numfree];
assert (mp != NULL);
- assert (Py_TYPE(mp) == &PyDict_Type);
+ assert (Py_IS_TYPE(mp, &PyDict_Type));
_Py_NewReference((PyObject *)mp);
}
else {
@@ -2007,7 +2007,7 @@ dict_dealloc(PyDictObject *mp)
assert(keys->dk_refcnt == 1);
dictkeys_decref(keys);
}
- if (numfree < PyDict_MAXFREELIST && Py_TYPE(mp) == &PyDict_Type)
+ if (numfree < PyDict_MAXFREELIST && Py_IS_TYPE(mp, &PyDict_Type))
free_list[numfree++] = mp;
else
Py_TYPE(mp)->tp_free((PyObject *)mp);
@@ -3864,15 +3864,15 @@ dictreviter_iternext(dictiterobject *di)
di->di_pos = i-1;
di->len--;
- if (Py_TYPE(di) == &PyDictRevIterKey_Type) {
+ if (Py_IS_TYPE(di, &PyDictRevIterKey_Type)) {
Py_INCREF(key);
return key;
}
- else if (Py_TYPE(di) == &PyDictRevIterValue_Type) {
+ else if (Py_IS_TYPE(di, &PyDictRevIterValue_Type)) {
Py_INCREF(value);
return value;
}
- else if (Py_TYPE(di) == &PyDictRevIterItem_Type) {
+ else if (Py_IS_TYPE(di, &PyDictRevIterItem_Type)) {
Py_INCREF(key);
Py_INCREF(value);
result = di->di_result;
@@ -4236,7 +4236,7 @@ _PyDictView_Intersect(PyObject* self, PyObject *other)
/* if other is a set and self is smaller than other,
reuse set intersection logic */
- if (Py_TYPE(other) == &PySet_Type && len_self <= PyObject_Size(other)) {
+ if (Py_IS_TYPE(other, &PySet_Type) && len_self <= PyObject_Size(other)) {
_Py_IDENTIFIER(intersection);
return _PyObject_CallMethodIdObjArgs(other, &PyId_intersection, self, NULL);
}