[Python-Dev] Re: PEP 285: Adding a bool type
Guido van Rossum
guido at python.org
Wed Apr 3 14:07:21 EST 2002
> (Python docs tend to use "true" to mean anything which isn't
> "false", and where operator.truth returns the right thing. this
> won't change post-PEP -- if you start interpreting "return true" as
> "return True", you'll be asking for trouble)
Unclear. I intend to change as many functions as I reasonably can to
return True/False, and I intend to change their documentation to
match.
While some of the documentation indeed talks of "true" and "false",
those are not well-defined values. They are properties of values, and
I find it bad style to say "f() returns true if X and false
otherwise". I would have written that either as "f() returns a true
value if X and a false value otherwise" (in case I don't want to
commit to returning 0 or 1), or "f() returns 1 if X, 0 otherwise" (in
case I do).
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-list
mailing list