PEP 285: Adding a bool type

Aahz aahz at pythoncraft.com
Sun Mar 31 13:47:13 EST 2002


In article <mailman.1017597529.7660.python-list at python.org>,
Tim Peters  <tim.one at comcast.net> wrote:
>[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.

But what do you think of changing bool() to truth()?
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Why is this newsgroup different from all other newsgroups?



More information about the Python-list mailing list