PEP 285: Adding a bool type

Laura Creighton lac at strakt.com
Sat Apr 6 14:13:38 EST 2002


Thank you very much for the reply.
I just want to correct something you ascribed to me.

> I guess we'll have to agree to disagree here: I don't think that bools
> are bad, either Python's variety or any other language's kind.  I've
> seen your arguments, and they just don't convince me.  So be it.

I think there is a time and a place for bools --  Describing things
that have two states that can never, ever, have 3 or more states.  
These things are vanishingly close to non-existent, unless you are
a mathematician in which case you may be playing with these sorts
of things all the time.  What I am trying to do is save people
like Mark McEahern from his isValid function, which returns whether
a username is valid or not.  On the day his boss demands a third
value - valid-but-I-won't-let-you-in-anyway-you-didn't-pay-your-bill,
he will thank me.

That is what I mean by teaching people not to use bools -- teaching
when not to use them. This is very hard to teach.  I know it because
I have been doing it for years and years.   I even know _why_ it is
hard to teach, but that doesn't make it any easier.

Laura





More information about the Python-list mailing list