File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -192,6 +192,40 @@ \subsection{Plain Integer Objects \label{intObjects}}
192192 header files).
193193\end {cfuncdesc }
194194
195+ \subsubsection {Boolean Objects \label {boolObjects } }
196+
197+ Booleans in Python are implemented as a subclass of integers. There
198+ are only two booleans, \constant {Py_False} and \constant {Py_True}. As
199+ such, the normal creation and deletion functions don't apply to
200+ booleans. The following macros are available, however.
201+
202+ \begin {cfuncdesc }{int}{PyBool_Check}{PyObject* o}
203+ Returns true if \var {o} is of type \cdata {PyBool_Type}.
204+ \versionadded {2.3}
205+ \end {cfuncdesc }
206+
207+ \begin {cfuncdesc }{Py_RETURN_FALSE}
208+ Return Py_False from a function, properly incrementing its reference
209+ count.
210+ \versionadded {2.4}
211+ \end {cfuncdesc }
212+
213+ \begin {cfuncdesc }{Py_RETURN_TRUE}
214+ Return Py_True from a function, properly incrementing its reference
215+ count.
216+ \versionadded {2.4}
217+ \end {cfuncdesc }
218+
219+ \begin {cfuncdesc }{int}{PyBool_Check}{PyObject* o}
220+ Returns true if \var {o} is of type \cdata {PyBool_Type}.
221+ \versionadded {2.3}
222+ \end {cfuncdesc }
223+
224+ \begin {cfuncdesc }{int}{PyBool_FromLong}{long v}
225+ Returns \constant {Py_True} or \constant {Py_False} depending on the
226+ truth value of \var {v}.
227+ \versionadded {2.3}
228+ \end {cfuncdesc }
195229
196230\subsection {Long Integer Objects \label {longObjects } }
197231
You can’t perform that action at this time.
0 commit comments