classification
Title: Rephrasing the doc of object.__nonzero__
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: ezio.melotti, georg.brandl
Priority: normal Keywords:

Created on 2009-03-15 13:21 by ezio.melotti, last changed 2009-03-15 21:45 by georg.brandl. This issue is now closed.

Messages (2)
msg83630 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2009-03-15 13:21
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__
msg83642 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-03-15 21:37
Thanks, fixed in r70387.
History
Date User Action Args
2009-03-15 21:45:03georg.brandlsetstatus: open -> closed
2009-03-15 21:37:31georg.brandlsetresolution: fixed
messages: + msg83642
2009-03-15 13:21:22ezio.melotticreate