]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Clarify that the bool instances are acceptable return values from
authorFred Drake <fdrake@acm.org>
Wed, 7 Aug 2002 15:41:31 +0000 (15:41 +0000)
committerFred Drake <fdrake@acm.org>
Wed, 7 Aug 2002 15:41:31 +0000 (15:41 +0000)
__nonzero__(), in response to SF bug #579991.

Doc/lib/libstdtypes.tex

index 911999e748d6be6384a7d278e1dcff86910f9c60..31862f7c8e8bb620a2ad5ed5e0e1a2dea589b70d 100644 (file)
@@ -28,7 +28,10 @@ The following values are considered false:
 \begin{itemize}
 
 \item  \code{None}
-       \withsubitem{(Built-in object)}{\ttindex{None}}
+        \withsubitem{(Built-in object)}{\ttindex{None}}
+
+\item   \code{False}
+        \withsubitem{(Built-in object)}{\ttindex{False}}
 
 \item  zero of any numeric type, for example, \code{0}, \code{0L},
         \code{0.0}, \code{0j}.
@@ -38,8 +41,9 @@ The following values are considered false:
 \item  any empty mapping, for example, \code{\{\}}.
 
 \item  instances of user-defined classes, if the class defines a
-       \method{__nonzero__()} or \method{__len__()} method, when that
-       method returns the integer zero.\footnote{Additional
+        \method{__nonzero__()} or \method{__len__()} method, when that
+        method returns the integer zero or \class{bool} value
+        \code{False}.\footnote{Additional 
 information on these special methods may be found in the
 \citetitle[../ref/ref.html]{Python Reference Manual}.}