PEP 285: Adding a bool type

Terry Reedy tejarex at yahoo.com
Mon Apr 1 01:56:56 EST 2002


"Erik Max Francis" <max at alcyone.com> wrote in message
news:3CA7D34D.F054FB95 at alcyone.com...
> Terry Reedy wrote:
>
> > Yesterday, I gave four reasons for prefering 'truth' (or something
> > else) to bool.   Please consider them.  Already, my prediction in
> > point D is being borne out in some subsequent posts by some.
> > Something about the word 'bool(ean)' sets off something in some
> > people's brain that makes them want cripple a formalized Python
truth
> > type by prohibiting currently valid and useful behavior.  I find
this
> > as offensive both to the spirit of Python and my programming
freedom
> > as the suggestion that sequence*int should be deprecated and then
> > prohibited because it violates some standard of 'proper' sequence
> > behavior.  Rather than have to put up with and have to argue
against
> > such suggestions for the rest of my life, I would rather switch to
a
> > different term that does not carry with it the baggage that 'bool'
so
> > obviously does.
>
> But "truth" is the wrong word; you mean truth _value_.  Calling the
type
> name "truth" gives the impression that the only value it can have is
> True :-).

OK.  I suggested binary and tval as two other alternatives.

> This seems a semantic argument;

Yes, I did give a semantic argument as one of four yesterday, but what
you quote above from today is a very pragmatic argument based on
obseerved current behavior and predicted future behavior.

> I don't see any compelling reasons for  calling it anything other
than the common name.

I read this proposal a couple of weeks ago and did not think twice
about 'bool' until I saw several people taking use of the common name
as reason to drastically change Python truth values to conform to
their idea/model of what the common name means.

> The reason It doesn't make sense
> to follow other languages' lead _for its own sake_, but it sure does
if
> that is by far and away the most common name for that type of thing.

The problem for some is the difference between the thing itself and
Python's Pythonic version that is something like that thing but
definately not a copy of the thing itself.  So my alternative to
changing the name is awareness that there is and will be this problem
and a suggestion that the documentation and presentation emphasize
that Python truth values are not the same as standard mathematical
Boolean values and are not intended to be and never will be (I hope).
(Anymore than Python lists exactly conform to certain other models of
what a computer language 'list' is 'supposed' to be.)

> Such values are called "Booleans" (an instantly recognizeable name
in
> computer science) far more often than they're called "truth
functional
> values," or "truth values," or (more to the point) "truths."

Given my Fortran (logical), Basic (?), and C (no official name)
pre-Python background, I admittedly find this less compelling than
someone coming from Pascal or whatever.


Terry J. Reedy







More information about the Python-list mailing list