simultaneous assignment

Steve R. Hastings steve at hastings.org
Tue May 2 23:24:34 EDT 2006


On Tue, 02 May 2006 21:20:48 +0200, Boris Borcic wrote:

> Steve R. Hastings wrote:
>> So, don't test to see if something is equal to True or False:
>> 
>> if 0 == False:
>>     pass  # never executed; False and 0 do not directly compare
> 
> of course they do - ie  isinstance(False,int) is True and False == 0

I stand corrected.  I tested most of my examples; I thought I had tested
that example, but clearly I did not.

I just tried "0 == False" in Python and it does evaluate True.

"[] == False" still does not, of course...

Thank you for the correction.
-- 
Steve R. Hastings    "Vita est"
steve at hastings.org    http://www.blarg.net/~steveha




More information about the Python-list mailing list