Message83630
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__ |
|
Date |
User |
Action |
Args |
2009-03-15 13:21:24 | ezio.melotti | set | recipients:
+ ezio.melotti, georg.brandl |
2009-03-15 13:21:24 | ezio.melotti | set | messageid: <1237123284.32.0.590929476776.issue5493@psf.upfronthosting.co.za> |
2009-03-15 13:21:22 | ezio.melotti | link | issue5493 messages |
2009-03-15 13:21:22 | ezio.melotti | create | |
|