[Python-checkins] r71653 - python/trunk/Doc/library/functions.rst
raymond.hettinger
python-checkins at python.org
Thu Apr 16 20:16:10 CEST 2009
Author: raymond.hettinger
Date: Thu Apr 16 20:16:10 2009
New Revision: 71653
Log:
Clarify the behavior of any() and all() with an empty iterable.
Modified:
python/trunk/Doc/library/functions.rst
Modified: python/trunk/Doc/library/functions.rst
==============================================================================
--- python/trunk/Doc/library/functions.rst (original)
+++ python/trunk/Doc/library/functions.rst Thu Apr 16 20:16:10 2009
@@ -17,7 +17,8 @@
.. 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 @@
.. 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:
More information about the Python-checkins
mailing list