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

Walter Dörwald walter@livinglogic.de
Mon, 11 Mar 2002 13:59:04 +0100


Greg Ewing wrote:
> Ka-Ping Yee <ping@lfw.org>:
> 
> 
>>But in the new scheme, there is a "blessed" Boolean type.  Does this
>>make the other kinds of true and false less legitimate?

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.

Bye,
    Walter Dörwald

-- 
Walter Dörwald · LivingLogic AG, Bayreuth/Germany · www.livinglogic.de