Status of PEP's?

James_Althoff at i2.com James_Althoff at i2.com
Tue Mar 5 14:30:35 EST 2002


[Tim Delaney]
> Just realised something for PEP 276.
>
> If it passes,
>
> for i in dictionary.has_key(item):
>
> would then be valid ... as it would return 0 or 1.

On the other hand, if it *doesn't* pass
    dictionary.has_key(item) ** dictionary.has_key(item)
will be valid <wink>.

> This may or
> may not be considered a bad thing - it would be equivalent to:
>
> if dictionary.has_key(item):
>
> for any condition that does return 0 or 1.

As you point out, this oddity is odd in a relatively benign sort of way, at
least <wink>.  More seriously though, I think that this falls into the
category of trade-offs that one deals with when taking advantage of
Python's "less explicit, but more practical" choice of using domain values
for true/false rather than using explicit boolean objects.

Jim






More information about the Python-list mailing list