[Python-checkins] cpython (2.7): #17178: update any()/all() docstrings to document their behavior with empty
ezio.melotti
python-checkins at python.org
Fri Feb 15 22:38:37 CET 2013
http://hg.python.org/cpython/rev/0f7eec78569c
changeset: 82215:0f7eec78569c
branch: 2.7
parent: 82211:e63c4bc81d9f
user: Ezio Melotti <ezio.melotti at gmail.com>
date: Fri Feb 15 23:35:14 2013 +0200
summary:
#17178: update any()/all() docstrings to document their behavior with empty iterables. Patch by Ankur Ankan.
files:
Misc/ACKS | 1 +
Python/bltinmodule.c | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -33,6 +33,7 @@
Erik Andersén
Oliver Andrich
Ross Andrus
+Ankur Ankan
Heidi Annexstad
Éric Araujo
Jeffrey Armstrong
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -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)
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list