PEP 285: Adding a bool type

Tim Peters tim.one at comcast.net
Sun Mar 31 12:56:52 EST 2002


[Ralph Corderoy, to Guido]
> What do you think of `truth(x)' for all the good reasons listed
> elsewhere in the thread?  You used truth yourself instead of Boolean
> above.

Actually, he didn't.  True story:  we (PythonLabs) recently chatted with Jim
Fulton (Zope Corp's CTO, Guido's boss, and very long-time Python user) about
truth values in Python.  Jim declaimed that he always wished Python had a
function to convert Python's notion of true/false into an integer 1/0, and
suggested that "truth()" would be a good name for it.  He didn't realize
that operator.truth() was already there, and does exactly what he asked for.
I had a nagging suspicion, so dug into the CVS history then, and discovered
that operator.truth() was added for Python 1.4 -- and the code was
contributed by (tada!) Jim Fulton.  He did the work in the last millennium,
and simply forgot all about it then.

So if anyone on c.l.py ever feels silly about asking for a feature that's
already there, don't -- the people who *implement* features sometimes do the
same thing.

e.g.-i-still-wish-math.log(2L**100000)-didn't-blow-up-ly y'rs  - tim





More information about the Python-list mailing list