diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2015-05-30 15:29:53 (GMT) |
---|---|---|
committer | Eric Snow <ericsnowcurrently@gmail.com> | 2015-05-30 15:29:53 (GMT) |
commit | 8c7ed012b87db4de66da61c2f7c0a11a61277384 (patch) | |
tree | 7e4b8d09555abf03483af4c01967a72636b7dab6 /Include/dictobject.h | |
parent | 7aa5341164794efc5367f63636cbe8327ca40393 (diff) | |
download | cpython-8c7ed012b87db4de66da61c2f7c0a11a61277384.zip cpython-8c7ed012b87db4de66da61c2f7c0a11a61277384.tar.gz cpython-8c7ed012b87db4de66da61c2f7c0a11a61277384.tar.bz2 |
Issue #16991: Use PyObject_TypeCheck instead of PyObject_IsInstance.
Diffstat (limited to 'Include/dictobject.h')
-rw-r--r-- | Include/dictobject.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Include/dictobject.h b/Include/dictobject.h index 17262fe..320f9ec 100644 --- a/Include/dictobject.h +++ b/Include/dictobject.h @@ -45,9 +45,9 @@ PyAPI_DATA(PyTypeObject) PyDictValues_Type; #define PyDict_Check(op) \ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_DICT_SUBCLASS) #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) -#define PyDictKeys_Check(op) (PyObject_IsInstance(op, (PyObject *)&PyDictKeys_Type)) -#define PyDictItems_Check(op) (PyObject_IsInstance(op, (PyObject *)&PyDictItems_Type)) -#define PyDictValues_Check(op) (PyObject_IsInstance(op, (PyObject *)&PyDictValues_Type)) +#define PyDictKeys_Check(op) PyObject_TypeCheck(op, &PyDictKeys_Type) +#define PyDictItems_Check(op) PyObject_TypeCheck(op, &PyDictItems_Type) +#define PyDictValues_Check(op) PyObject_TypeCheck(op, &PyDictValues_Type) /* This excludes Values, since they are not sets. */ # define PyDictViewSet_Check(op) \ (PyDictKeys_Check(op) || PyDictItems_Check(op)) |