PEP 285: Adding a bool type

Erik Max Francis max at alcyone.com
Wed Apr 3 14:26:15 EST 2002


Guido van Rossum wrote:

> That's an interesting response, because it highlights what I think is
> the main misunderstanding about the PEP.  You should think of it a
> very *small* change!
	...
> This is long enough of a response.  To those people who complain that
> I don't take their long thoughts seriously, I can only respond that I
> thought long and hard about this PEP too, and am similarly
> disappointed
> that it faces so much opposition based upon what *might* happen.

Indeed, I'm really surprised by the length of the responses and the
dissent against this PEP.  It seems to me a very simple change, simply
helping to clarify and codify an existing practice.  It seems highly
unlikely that any significant amount of code will break; code that
_does_ break would seem to be doing un-Pythonic things that go against
many of the very arguments that are being used to shoot down this PEP
(e.g., Python truth is something-vs.-nothing, etc.).

The something-vs.-nothing objection seems to be missing the point.  The
addition of bool does not affect what truth and falsity mean in Python,
it just adds another explicit set of values for use when that is all you
mean to talk about.  This supports more self-documenting, and instantly
clear code -- if I see True instead of 1, I know exactly what is
expected and what the possible values are.  bool won't affect the
meaning of "truth" in Python at all, so these objections seem to be red
herrings.

I'm really surprised at the volume of objections to a change that can
only help make code clearer and will have very few compatibility
ramifications.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Nationalism is an infantile sickness.
\__/ Albert Einstein
    Alcyone Systems' Daily Planet / http://www.alcyone.com/planet.html
 A new, virtual planet, every day.



More information about the Python-list mailing list