PEP 285: Adding a bool type
Chris Barker
Chris.Barker at noaa.gov
Tue Apr 2 12:18:32 EST 2002
Paul Rubin wrote:
> > if string.find(...):
> > do something.
>
> Are you proposing to start making 0 resolve as true? If not, returning
> False has the same problem as returning None.
Yes, I am. I realise that there is far too much history in both Computer
Science in general and Python in particular for it to ever happen, but I
do think that that is how it should be in the ideal language. The
concept of True or False is distinct from the concept of a number, and
I'd like to see it stay that way in the language.
Yes, you would be writing a lot of
if bool(expression):
rather than
if expression:
But I think it would be much more clear and less awkward.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker at noaa.gov
More information about the Python-list
mailing list