diff options
author | Raymond Hettinger <python@rcn.com> | 2009-04-16 18:16:10 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2009-04-16 18:16:10 (GMT) |
commit | 76162e305cedb4b332a6804df815044f297b4e95 (patch) | |
tree | 0209afa3ccc980205fc3b013e91aa6f16d19a035 | |
parent | 7203081025147efa18d7f36aa2bc234ba81498c3 (diff) | |
download | cpython-76162e305cedb4b332a6804df815044f297b4e95.zip cpython-76162e305cedb4b332a6804df815044f297b4e95.tar.gz cpython-76162e305cedb4b332a6804df815044f297b4e95.tar.bz2 |
Clarify the behavior of any() and all() with an empty iterable.
-rw-r--r-- | Doc/library/functions.rst | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 5ca6e42..a075afd 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -17,7 +17,8 @@ available. They are listed here in alphabetical order. .. function:: all(iterable) - Return True if all elements of the *iterable* are true. Equivalent to:: + Return True if all elements of the *iterable* are true (or if the iterable + is empty). Equivalent to:: def all(iterable): for element in iterable: @@ -30,7 +31,8 @@ available. They are listed here in alphabetical order. .. function:: any(iterable) - Return True if any element of the *iterable* is true. Equivalent to:: + Return True if any element of the *iterable* is true. If the iterable + is empty, return False. Equivalent to:: def any(iterable): for element in iterable: |