File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -45,9 +45,9 @@ PyAPI_DATA(PyTypeObject) PyDictValues_Type;
45
45
#define PyDict_Check (op ) \
46
46
PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_DICT_SUBCLASS)
47
47
#define PyDict_CheckExact (op ) (Py_TYPE(op) == &PyDict_Type)
48
- #define PyDictKeys_Check (op ) (PyObject_IsInstance( op, (PyObject *) &PyDictKeys_Type) )
49
- #define PyDictItems_Check (op ) (PyObject_IsInstance( op, (PyObject *) &PyDictItems_Type) )
50
- #define PyDictValues_Check (op ) (PyObject_IsInstance( op, (PyObject *) &PyDictValues_Type) )
48
+ #define PyDictKeys_Check (op ) PyObject_TypeCheck( op, &PyDictKeys_Type)
49
+ #define PyDictItems_Check (op ) PyObject_TypeCheck( op, &PyDictItems_Type)
50
+ #define PyDictValues_Check (op ) PyObject_TypeCheck( op, &PyDictValues_Type)
51
51
/* This excludes Values, since they are not sets. */
52
52
# define PyDictViewSet_Check (op ) \
53
53
(PyDictKeys_Check(op) || PyDictItems_Check(op))
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ PyAPI_DATA(PyTypeObject) PyODictValues_Type;
19
19
20
20
#endif /* Py_LIMITED_API */
21
21
22
- #define PyODict_Check (op ) PyObject_IsInstance (op, (PyObject *) &PyODict_Type)
22
+ #define PyODict_Check (op ) PyObject_TypeCheck (op, &PyODict_Type)
23
23
#define PyODict_CheckExact (op ) (Py_TYPE(op) == &PyODict_Type)
24
24
#define PyODict_SIZE (op ) ((PyDictObject *)op)->ma_used
25
25
#define PyODict_HasKey (od , key ) (PyMapping_HasKey(PyObject *)od, key)
You can’t perform that action at this time.
0 commit comments