STINNER Victor <[email protected]> added the comment:
Py_IS_TYPE(obj, type) was added to Python 3.9 by bpo-39573: https://docs.python.org/dev/c-api/structures.html#c.Py_IS_TYPE commit d905df766c367c350f20c46ccd99d4da19ed57d8 Author: Dong-hee Na <[email protected]> Date: Fri Feb 14 02:37:17 2020 +0900 bpo-39573: Add Py_IS_TYPE() function (GH-18488) Co-Author: Neil Schemenauer <[email protected]> It's currently implemented as: static inline int _Py_IS_TYPE(const PyObject *ob, const PyTypeObject *type) { return Py_TYPE(ob) == type; } #define Py_IS_TYPE(ob, type) _Py_IS_TYPE(_PyObject_CAST_CONST(ob), type) ---------- _______________________________________ Python tracker <[email protected]> <https://bugs.python.org/issue43753> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
