mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +00:00
bpo-39573: Add Py_IS_TYPE() function (GH-18488)
Co-Author: Neil Schemenauer <nas-github@arctrix.com>
This commit is contained in:
parent
968dcd9e7a
commit
d905df766c
32 changed files with 61 additions and 46 deletions
|
@ -9,7 +9,7 @@ extern "C" {
|
|||
|
||||
PyAPI_DATA(PyTypeObject) PyBool_Type;
|
||||
|
||||
#define PyBool_Check(x) (Py_TYPE(x) == &PyBool_Type)
|
||||
#define PyBool_Check(x) Py_IS_TYPE(x, &PyBool_Type)
|
||||
|
||||
/* Py_False and Py_True are the only two bools in existence.
|
||||
Don't forget to apply Py_INCREF() when returning either!!! */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue