PEP 285: Adding a bool type

Guido van Rossum guido at python.org
Sat Apr 6 22:54:05 EST 2002


[Guido]
> > Laura, you've said this over and over, and I don't buy it.
> >
> > Two arguments from XP apply here:
> >
> > - YAGNI (You Ain't Gonna Need It), or also "do the simplest thing that
> >   can possibly work".  If all you need today is a bool, use a bool.

[Laura]
> Aha, now I understand a large part of why we disagree.  A bool is not
> simpler than an int.  'Something that can change state' is simpler than
> 'something that can change state and must only have one of two values'.
> Do you go around making functions that return bool all the time, only
> then to change them to return int every time you have the idea that
> there actually are 3 states here you want to model?  Then you will
> be littered with one obsolete 2-valued function every time this happens.
> They pile up, and since your wretched customers have all started using
> the 2-value functions, you are stuck having to maintain these things,
> even though you now hate them, and want everybody to use the 3-value
> versions.

Sigh.  So much rhetoric, worthy a better cause.  Laura, you
can believe whatever you want, but I'll continue to define
functions that return bool whenever I think a bool makes sense.
I'm not responding to your diatribe about XP, which isn't
relevant (or if it is, you forgot to post the punch line).

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-list mailing list