Empty sets and frozensets are also false.

This commit is contained in:
Georg Brandl 2005-08-21 12:22:58 +00:00
parent 1823ae7e36
commit 6cd5377c72
1 changed files with 3 additions and 3 deletions

View File

@ -1021,9 +1021,9 @@ Boolean operations have the lowest priority of all Python operations:
In the context of Boolean operations, and also when expressions are
used by control flow statements, the following values are interpreted
as false: \code{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.
as false: \code{False}, \code{None}, numeric zero of all types, and empty
strings and containers (including strings, tuples, lists, dictionaries,
sets and frozensets). All other values are interpreted as true.
The operator \keyword{not} yields \code{True} if its argument is false,
\code{False} otherwise.