Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 442c7c7

Browse files
committed
Clarify that the bool instances are acceptable return values from
__nonzero__(), in response to SF bug #579991.
1 parent 2863c10 commit 442c7c7

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Doc/lib/libstdtypes.tex

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ \subsection{Truth Value Testing} \label{truth}
3333
\begin{itemize}
3434

3535
\item \code{None}
36-
\withsubitem{(Built-in object)}{\ttindex{None}}
36+
\withsubitem{(Built-in object)}{\ttindex{None}}
3737

3838
\item \code{False}
39-
\withsubitem{(Built-in object)}{\ttindex{False}}
39+
\withsubitem{(Built-in object)}{\ttindex{False}}
4040

4141
\item zero of any numeric type, for example, \code{0}, \code{0L},
4242
\code{0.0}, \code{0j}.
@@ -46,8 +46,9 @@ \subsection{Truth Value Testing} \label{truth}
4646
\item any empty mapping, for example, \code{\{\}}.
4747

4848
\item instances of user-defined classes, if the class defines a
49-
\method{__nonzero__()} or \method{__len__()} method, when that
50-
method returns the integer zero.\footnote{Additional
49+
\method{__nonzero__()} or \method{__len__()} method, when that
50+
method returns the integer zero or \class{bool} value
51+
\code{False}.\footnote{Additional
5152
information on these special methods may be found in the
5253
\citetitle[../ref/ref.html]{Python Reference Manual}.}
5354

0 commit comments

Comments
 (0)