Boolean对象¶
Python中的布尔值作为一个子类的整数实现。只有两个布尔值:Py_False 和 Py_True。 因此,正常的创造和删除功能不适用于布尔值,然而有以下的宏。
-
PyTypeObject PyBool_Type¶
- Part of the Stable ABI.
This instance of
PyTypeObjectrepresents the Python boolean type; it is the same object asboolin the Python layer.
-
int PyBool_Check(PyObject *o)¶
Return true if o is of type
PyBool_Type. This function always succeeds.
-
PyObject *PyBool_FromLong(long v)¶
- Return value: New reference. Part of the Stable ABI.