diff Python/bltinmodule.c @ 82215:0f7eec78569c 2.7

#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 3b484f53f91b
children c5f5b5e89a94
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
@@ -120,7 +120,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)
@@ -162,7 +163,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_apply(PyObject *self, PyObject *args)