Alan asked:
> > 2. If I really want a value True will I ever go astray with the test:
> > if a is True:
> > >>> a = True
> > >>> b = 1.
> > >>> c = 1
> > >>> a is True, b is True, c is True
> > (True, False, False)

"Ziga Seilnacht" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I think that True and False, although they were added in version
> 2.3, were not true singeltons until version 2.4.

OK, but Python 2.3 yields the same result as above.

Ziga  wrote:
> You should finish
> reading the PEP, see especially this part:
> - Don't compare boolean values to True or False using ==
>     Yes:   if greeting:
>     No:    if greeting == True:
>     Worse: if greeting is True:


I do not think this is relevant to the question I asked,
which was how to test for a value of True, if that's
what I really want.  I think the outcome of this
discussion has been: use 'is'.

Thanks,
Alan


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to