From: Skip Montanaro Date: Thu, 29 Jul 2004 02:29:24 +0000 (+0000) Subject: backport relevant bits of the bool api docs X-Git-Tag: v2.3.5c1~148 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d9c73b592267a2df9f9c96511acb5d2afd8fe692;p=thirdparty%2FPython%2Fcpython.git backport relevant bits of the bool api docs --- diff --git a/Doc/api/concrete.tex b/Doc/api/concrete.tex index 0d58b59003e2..38e570a7f00c 100644 --- a/Doc/api/concrete.tex +++ b/Doc/api/concrete.tex @@ -189,6 +189,39 @@ There is no \cfunction{PyNone_Check()} function for the same reason. \end{cfuncdesc} +\subsubsection{Boolean Objects \label{boolObjects}} + +Booleans in Python are implemented as a subclass of integers. There +are only two booleans, \constant{Py_False} and \constant{Py_True}. As +such, the normal creation and deletion functions don't apply to +booleans. The following macros are available, however. + +\begin{cfuncdesc}{int}{PyBool_Check}{PyObject* o} + Returns true if \var{o} is of type \cdata{PyBool_Type}. + \versionadded{2.3} +\end{cfuncdesc} + +\begin{cvardesc}{PyObject*}{Py_False} + The Python \code{False} object. This object has no methods. It needs to + be treated just like any other object with respect to reference counts. +\end{cvardesc} + +\begin{cvardesc}{PyObject*}{Py_True} + The Python \code{True} object. This object has no methods. It needs to + be treated just like any other object with respect to reference counts. +\end{cvardesc} + +\begin{cfuncdesc}{int}{PyBool_Check}{PyObject* o} + Returns true if \var{o} is of type \cdata{PyBool_Type}. + \versionadded{2.3} +\end{cfuncdesc} + +\begin{cfuncdesc}{int}{PyBool_FromLong}{long v} +Returns \constant{Py_True} or \constant{Py_False} depending on the +truth value of \var{v}. +\versionadded{2.3} +\end{cfuncdesc} + \subsection{Long Integer Objects \label{longObjects}} \obindex{long integer}