"0 in [True,False]" returns True

bonono at gmail.com bonono at gmail.com
Tue Dec 13 05:18:45 EST 2005


Erik Max Francis wrote:
> bonono at gmail.com wrote:
>
> > True, but if that is the only reason, Two built-in value of
> > True/False(0/1) serves the need which is what is now(well sort of). Why
> > have seperate types and distinguish them ?
>
> Because of this:
>
> 	x = True
> 	y = 1 # but I mean it to represent true
>
> 	print x, y
>
> Besides, it's not the only reason, but it's a good one.
>
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.




More information about the Python-list mailing list