True/False

sismex01 at hebmex.com sismex01 at hebmex.com
Tue Apr 22 20:35:32 CEST 2003


> From: Ian Bicking [mailto:ianb at colorstudy.com]
> Sent: Tuesday, April 22, 2003 1:30 PM
> 
> [...snip...]
>
> import sys
> if sys.version_info < (2, 3):
>     True, False = 1==1, 0==1
> 
> But I *so* don't want to do this.  Is there any reason why reassigning
> True and False will be a problem in the future?  Should I tell people
> who are putting in version tests that it isn't necessary?
> 
>   Ian
>

No problem, because (1==1) will evaluate to True [or bool(1)]
and (1==0) will evaluate to False [or bool(0)].

hth

-gus





More information about the Python-list mailing list