]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
mention how to override boolean evaluation
authorBenjamin Peterson <benjamin@python.org>
Tue, 23 Sep 2008 13:32:46 +0000 (13:32 +0000)
committerBenjamin Peterson <benjamin@python.org>
Tue, 23 Sep 2008 13:32:46 +0000 (13:32 +0000)
Doc/reference/expressions.rst

index 1566a99a23a3124b10ca5c7a1eacfe825daed890..e5e40cf0a084b033793f786a52c85516ff1e266c 100644 (file)
@@ -1143,7 +1143,8 @@ In the context of Boolean operations, and also when expressions are used by
 control flow statements, the following values are interpreted as false:
 ``False``, ``None``, numeric zero of all types, and empty strings and containers
 (including strings, tuples, lists, dictionaries, sets and frozensets).  All
-other values are interpreted as true.
+other values are interpreted as true.  (See the :meth:`~object.__nonzero__`
+special method for a way to change this.)
 
 .. index:: operator: not