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

Peter Funk pf@artcom-gmbh.de
Tue, 12 Mar 2002 08:42:55 +0100 (CET)


Hi,

Paul Prescod:
> "Gerald S. Williams" wrote:
> > 
> > Please don't take this as a real endorsement, and YMMV to
> > be sure, but somehow this seems right to me given the way
> > Python currently determines "truth":
> > 
> > >>> 1 == True, 2 == True, [] == False
> > (True, True, True)
> 
> I'm confident that will never be the case.
> 
> if x:
>   ...
> 
> should be considered a shortcut syntax for
> 
> if bool(x):
>    ...
> 
> That says nothing about the equality of the object x and one of the two
> truth constants. 

That would slaughter backward compatibility.  And that would
hurt the trust and expectations of current Python users.

Please don't do this.  
Please don't sacrifice backward compatibility.

Regards, Peter
-- 
Peter Funk, Oldenburger Str.86, D-27777 Ganderkesee, Germany, Fax:+49 4222950260
office: +49 421 20419-0 (ArtCom GmbH, Grazer Str.8, D-28359 Bremen, Germany)