This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Rephrasing the doc of object.__nonzero__
Type: Stage:
Components: Documentation Versions:
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 2022-04-11 14:56 by admin. 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:
    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).

msg83642 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-03-15 21:37
Thanks, fixed in r70387.
Date User Action Args
2022-04-11 14:56:46adminsetgithub: 49743
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