isinstance(False, int)

Arnaud Delobelle arnodel at googlemail.com
Fri Mar 5 19:03:49 CET 2010


mk <mrkafk at gmail.com> writes:

>>>> isinstance(False, int)
> True
>>>>
>>>> isinstance(True, int)
> True
>
> Huh?
>
>>>>
>>>> issubclass(bool, int)
> True
>
> Huh?!
>
> Regards,
> mk

Yes, and:

>>> True + False
1

In fact:

>>> 1 == True
True
>>> 0 == False
True

So what's your question?

-- 
Arnaud



More information about the Python-list mailing list