Boolean Objects¶
Booleans in Python are implemented as a subclass of integers. There are onlytwo booleans,Py_False andPy_True. As such, the normalcreation and deletion functions don’t apply to booleans. The following macrosare available, however.
- PyTypeObjectPyBool_Type¶
- Part of theStable ABI.
This instance of
PyTypeObjectrepresents the Python boolean type; itis the same object asboolin the Python layer.
- intPyBool_Check(PyObject*o)¶
Return true ifo is of type
PyBool_Type. This function alwayssucceeds.
- PyObject*PyBool_FromLong(longv)¶
- Return value: New reference. Part of theStable ABI.