Message405577
Interesting. It seems like several call sites already check the equality case:
---- setobject.h: ----
#define PyFrozenSet_Check(ob) \
(Py_IS_TYPE(ob, &PyFrozenSet_Type) || \
PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type))
---- object.h: ----
static inline int _PyObject_TypeCheck(PyObject *ob, PyTypeObject *type) {
return Py_IS_TYPE(ob, type) || PyType_IsSubtype(Py_TYPE(ob), type);
}
#define PyObject_TypeCheck(ob, type) _PyObject_TypeCheck(_PyObject_CAST(ob), type)
Perhaps it would be better to use PyObject_TypeCheck where applicable (such as in the type_call function you mention, and in abstract.c's binary_op1()). |
|
Date |
User |
Action |
Args |
2021-11-03 02:14:13 | Dennis Sweeney | set | recipients:
+ Dennis Sweeney, itamaro |
2021-11-03 02:14:12 | Dennis Sweeney | set | messageid: <1635905652.99.0.367634578287.issue45697@roundup.psfhosted.org> |
2021-11-03 02:14:12 | Dennis Sweeney | link | issue45697 messages |
2021-11-03 02:14:12 | Dennis Sweeney | create | |
|