"0 in [True,False]" returns True

bonono at gmail.com bonono at gmail.com
Tue Dec 13 05:30:16 EST 2005


Erik Max Francis wrote:
> bonono at gmail.com wrote:
>
> > True too, and could be the reason(or similar too) why the OP wants to
> > test the type rather than the logical value of it.
>
> The type is for the self-documentation purposes.  The value is the same;
> so no, that's not a good reason either.
>
I don't know why he wants it, let alone whether it is a good or bad
reason. The only thing I read from his post is that he wants to
distinguish the type, why and how it fits in his big picture, no one
but he knows. It could be for similar reason, say to document the
content of data, store it in text file, translate it to another
language(say converting python object to js object but I forgot if
javascript treat 0/1 the same way as python).




More information about the Python-list mailing list