[Python-Dev] PEP 285: Adding a bool type

Patrick K. O'Brien pobrien at orbtech.com
Wed Apr 3 15:14:44 EST 2002


[Guido van Rossum]
> My thoughts haven't changed at all. :-)
>
> The first round of discussion (on python-dev) brought up some
> contentious issues where people disagreed strongly with particular
> details proposed in the PEP, and I put those contentious issues at the
> top of the review list.  If you go to the latest version of the PEP on
> the web (http://www.python.org/peps/pep-0285.html) you'll see that
> I've added some other issues that were brought up in the more recent
> discussion.

I apologize for not having read the web version. I wasn't aware that it was
being updated during the debate. I have a feeling I'm not alone in this
mistake, so I'll take this opportunity to encourage others to read the web
version also.

> There's an educational issue that I'm just getting my head around.  It
> appears that for various psychological and linguistic reasons, newbies
> naturally write
>
>     if b == True: ...
>
> when they first encounter a bool variable and have to test whether
> it's true.  I believe that this is most of Laura's issue.  The only
> reasonable solution for this is that the Zen master slaps them over
> the head with a stick, and they learn to write
>
>     if b: ...

Yes. And I think describing Python's handling of truth values as "something
vs. nothing" has real merit as a learning aid. It will certainly keep me
from falling into the if b == True: trap.

In summary, I agree with your clarifications and I'm +1 on the PEP.

---
Patrick K. O'Brien
Orbtech






More information about the Python-list mailing list