2 cdef extern from "Python.h":
4 ############################################################################
5 # 7.2.2 Boolean Objects
6 ############################################################################
8 ctypedef class __builtin__.bool [object PyBoolObject]:
11 # Booleans in Python are implemented as a subclass of
12 # integers. There are only two booleans, Py_False and Py_True. As
13 # such, the normal creation and deletion functions don't apply to
14 # booleans. The following macros are available, however.
16 bint PyBool_Check(object o)
17 # Return true if o is of type PyBool_Type.
20 # The Python False object. This object has no methods. It needs to
21 # be treated just like any other object with respect to reference
25 # The Python True object. This object has no methods. It needs to
26 # be treated just like any other object with respect to reference
30 # Return Py_False from a function, properly incrementing its reference count.
33 # Return Py_True from a function, properly incrementing its reference count.
35 object PyBool_FromLong(long v)
36 # Return value: New reference.
37 # Return a new reference to Py_True or Py_False depending on the truth value of v.