PEP 285: Adding a bool type: yes, but not as int subtype

Tim Peters tim.one at comcast.net
Mon Apr 1 18:42:49 EST 2002


[Kris J. Zaragoza, resisting digital catharsis]
> Gotta love those digital seances. :) Thanks, Tim.  This does make me
> feel a bit better about what direction this is taking.

If you want to feel a lot better, read the most recent revision of the PEP:
I see Guido added a "Clarification" section near the end, in which he says
"Kris Zaragoza's concerns are paranoid foolishness, not worth my precious
time to expose for the baseless hysteria they most obviously are".  Or
something like that -- I'm not actually sure he named you specifically.

> ...
> I have read the PEP, but based on that alone, I don't see any reasons
> that are terribly compelling.  Perhaps it's just that I'm an
> experienced developer or that I have a CS degree.  I just don't find
> the basic concepts as they are that hard to grasp.  That's why I keep
> wondering how much aid this will really be to a new or inexperienced
> programmer.

That's why I asked whether you had read the PEP.  The Rationale section
contains 6 distinct paragraphs, only one of which mentions (indirectly)
new/inexperienced programmers.  Will they, as claimed, require a millisecond
less thought each time they see

>>> 2-1  # doesn't change
1
>>> 2<1  # changes to False
0
>>>

?  Probably, but I don't really care -- nobody tried to make computers easy
for me, and suffering builds character <wink>.  I've been at this for
decades now, and I'll need a millisecond less thought.

To the extent I like the PEP, I'm mostly in the second paragraph:  there's
always some uncertainty when reading a function whether a "return 1" is
intended as a true/false result, or as an integer result.  I don't care that
the PEP leaves them much the same under the covers, I care that it allows
clearer expression of *intent*.  It's the same reason hundreds of C projects
#define their way into the same almost-inconsequential (under the covers)
distinction.  In the heat of battle, I'm not going to bother writing

    return 1  # true

but I will bother writing

    return True

because my editor has extensive word-completion facilities <wink>.





More information about the Python-list mailing list