summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2004-07-28 14:17:04 (GMT)
committerSkip Montanaro <skip@pobox.com>2004-07-28 14:17:04 (GMT)
commit33ee76ae9ee9d0ad64f8e0a36bc711bab39bb11d (patch)
treee8f4c7f0e1309c95441c27bbc83c60c6bf213f6d /Doc
parentefdc16ffbb7a0fe8a03d2d4bcab9e166f42bbacd (diff)
downloadcpython-33ee76ae9ee9d0ad64f8e0a36bc711bab39bb11d.zip
cpython-33ee76ae9ee9d0ad64f8e0a36bc711bab39bb11d.tar.gz
cpython-33ee76ae9ee9d0ad64f8e0a36bc711bab39bb11d.tar.bz2
A little boolean music if you please, maestro... (Not sure I have the
versionadded{} args quite right).
Diffstat (limited to 'Doc')
-rw-r--r--Doc/api/concrete.tex34
1 files changed, 34 insertions, 0 deletions
diff --git a/Doc/api/concrete.tex b/Doc/api/concrete.tex
index 726634d..992442d 100644
--- a/Doc/api/concrete.tex
+++ b/Doc/api/concrete.tex
@@ -192,6 +192,40 @@ There is no \cfunction{PyNone_Check()} function for the same reason.
header files).
\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{cfuncdesc}{Py_RETURN_FALSE}
+Return Py_False from a function, properly incrementing its reference
+count.
+\versionadded{2.4}
+\end{cfuncdesc}
+
+\begin{cfuncdesc}{Py_RETURN_TRUE}
+Return Py_True from a function, properly incrementing its reference
+count.
+\versionadded{2.4}
+\end{cfuncdesc}
+
+\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}}