This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Dennis Sweeney
Recipients Dennis Sweeney, itamaro
Date 2021-11-03.02:14:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1635905652.99.0.367634578287.issue45697@roundup.psfhosted.org>
In-reply-to
Content
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()).
History
Date User Action Args
2021-11-03 02:14:13Dennis Sweeneysetrecipients: + Dennis Sweeney, itamaro
2021-11-03 02:14:12Dennis Sweeneysetmessageid: <1635905652.99.0.367634578287.issue45697@roundup.psfhosted.org>
2021-11-03 02:14:12Dennis Sweeneylinkissue45697 messages
2021-11-03 02:14:12Dennis Sweeneycreate