]> granicus.if.org Git - python/commitdiff
#5493: clarify __nonzero__ docs.
authorGeorg Brandl <georg@python.org>
Sun, 15 Mar 2009 21:37:16 +0000 (21:37 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 15 Mar 2009 21:37:16 +0000 (21:37 +0000)
Doc/reference/datamodel.rst

index d083af518e30c6697bf9dd6db03ddd10466bc162..0c1a10e663ecf5a70e994268f9db6f13c9bac377 100644 (file)
@@ -1424,11 +1424,12 @@ Basic customization
 
    .. index:: single: __len__() (mapping object method)
 
-   Called to implement truth value testing, and the built-in operation ``bool()``;
+   Called to implement truth value testing and the built-in operation ``bool()``;
    should return ``False`` or ``True``, or their integer equivalents ``0`` or
-   ``1``. When this method is not defined, :meth:`__len__` is called, if it is
-   defined (see below).  If a class defines neither :meth:`__len__` nor
-   :meth:`__nonzero__`, all its instances are considered true.
+   ``1``.  When this method is not defined, :meth:`__len__` is called, if it is
+   defined, and the object is considered true if its result is nonzero.
+   If a class defines neither :meth:`__len__` nor :meth:`__nonzero__`, all its
+   instances are considered true.
 
 
 .. method:: object.__unicode__(self)