diff options
author | Raymond Hettinger <python@rcn.com> | 2004-04-23 17:11:47 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-04-23 17:11:47 (GMT) |
commit | 46a16f297f0249bbb0c446a80bf2ae927f971e97 (patch) | |
tree | 3100d6a91d0efbcc3bdf96d2d950930b2bf6793d /Doc/ref | |
parent | 602472215ba901d357f959cfa78f010809491638 (diff) | |
download | cpython-46a16f297f0249bbb0c446a80bf2ae927f971e97.zip cpython-46a16f297f0249bbb0c446a80bf2ae927f971e97.tar.gz cpython-46a16f297f0249bbb0c446a80bf2ae927f971e97.tar.bz2 |
SF bug #940579: section 5.10: 'not' returns boolean, not int
Diffstat (limited to 'Doc/ref')
-rw-r--r-- | Doc/ref/ref5.tex | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/ref/ref5.tex b/Doc/ref/ref5.tex index 8d2c27e..cb181d5 100644 --- a/Doc/ref/ref5.tex +++ b/Doc/ref/ref5.tex @@ -977,8 +977,8 @@ as false: \code{None}, numeric zero of all types, empty sequences (strings, tuples and lists), and empty mappings (dictionaries). All other values are interpreted as true. -The operator \keyword{not} yields \code{1} if its argument is false, -\code{0} otherwise. +The operator \keyword{not} yields \code{True} if its argument is false, +\code{False} otherwise. \opindex{not} The expression \code{\var{x} and \var{y}} first evaluates \var{x}; if @@ -992,13 +992,13 @@ evaluated and the resulting value is returned. \opindex{or} (Note that neither \keyword{and} nor \keyword{or} restrict the value -and type they return to \code{0} and \code{1}, but rather return the +and type they return to \code{False} and \code{True}, but rather return the last evaluated argument. This is sometimes useful, e.g., if \code{s} is a string that should be replaced by a default value if it is empty, the expression \code{s or 'foo'} yields the desired value. Because \keyword{not} has to invent a value anyway, it does not bother to return a value of the -same type as its argument, so e.g., \code{not 'foo'} yields \code{0}, +same type as its argument, so e.g., \code{not 'foo'} yields \code{False}, not \code{''}.) \section{Lambdas\label{lambdas}} |