[issue5493] Rephrasing the doc of object.__nonzero__

Ezio Melotti report at bugs.python.org
Sun Mar 15 14:21:24 CET 2009


New submission from Ezio Melotti <ezio.melotti at gmail.com>:

The doc [1] actually says:
object.__nonzero__(self)
    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, __len__() is called, if it is
defined (see below). If a class defines neither __len__() nor
__nonzero__(), all its instances are considered true.

I suggest to:
1) drop the comma after 'testing';
2) clarify what happens when __nonzero__ is defined and where 'below'
actually is (and possibly add a link).


[1]: http://docs.python.org/reference/datamodel.html#object.__nonzero__

----------
assignee: georg.brandl
components: Documentation
messages: 83630
nosy: ezio.melotti, georg.brandl
severity: normal
status: open
title: Rephrasing the doc of object.__nonzero__

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5493>
_______________________________________


More information about the Python-bugs-list mailing list