diff Python/bltinmodule.c @ 82216:1d4849f9e37d 3.2

#17178: update any()/all() docstrings to document their behavior with empty iterables. Patch by Ankur Ankan.
author Ezio Melotti <ezio.melotti@gmail.com>
date Fri, 15 Feb 2013 23:35:14 +0200
parents 305d2aa5c129
children 34cfe145b286
line wrap: on
line diff
--- a/Python/bltinmodule.c	Fri Feb 15 21:27:18 2013 +0100
+++ b/Python/bltinmodule.c	Fri Feb 15 23:35:14 2013 +0200
@@ -262,7 +262,8 @@
 PyDoc_STRVAR(all_doc,
 "all(iterable) -> bool\n\
 \n\
-Return True if bool(x) is True for all values x in the iterable.");
+Return True if bool(x) is True for all values x in the iterable.\n\
+If the iterable is empty, return True.");
 
 static PyObject *
 builtin_any(PyObject *self, PyObject *v)
@@ -304,7 +305,8 @@
 PyDoc_STRVAR(any_doc,
 "any(iterable) -> bool\n\
 \n\
-Return True if bool(x) is True for any x in the iterable.");
+Return True if bool(x) is True for any x in the iterable.\n\
+If the iterable is empty, return False.");
 
 static PyObject *
 builtin_ascii(PyObject *self, PyObject *v)