PEP 285: Adding a bool type
Emile van Sebille
emile at fenx.com
Sun Mar 31 14:51:31 EST 2002
Erik Max Francis
> Stefan Schwarzer wrote:
> > but on the other hand have to keep in mind subtle interactions
between
> > bools and ints. For example, I consider it very unintutive that
> > "True == 1" should by true but "True == 2" should be false.
>
> Why? Implicit conversions seem un-Pythonic, so why would this be
> unfortunate? When you write (True == 2) you're asking, "Is the value
> true equal to the integer value 2?" the answer to which is clearly no.
If a=b, shouldn't a==a, a==b and b==a all be true?
Someone (Guido?) already mentioned that testing for true is redundant,
but doesn't :
if 2:
imply
if 2 == True:
which in turn then implies that:
True == 2
is true?
Or-would-we-be-restricted-to-while-1:-ly y'rs
--
Emile van Sebille
emile at fenx.com
---------
More information about the Python-list
mailing list