[Python-Dev] For review: PEP 285: Adding a bool type

Guido van Rossum guido@python.org
Mon, 11 Mar 2002 08:43:04 -0500


> These "other kinds of true and false" should IMHO be implemented
> via a conversion method __bool__ (just like __int__, __str__,
> __unicode__ etc.) and will be a bool aware version of __nonzero__
> which should be deprecated.
> 
> if should internally call this bool conversion method.

IMO there's no need to have a separate __bool__.  We can simply say
__nonzero__ may return 0 or False, or 1 or True.  I see no advantage
in introducing a separate __bool__.

--Guido van Rossum (home page: http://www.python.org/~guido/)