[2.7] bpo-33006 - Correct filter doc string to clarify 2nd argument can be iterable (GH-6015)

https://bugs.python.org/issue33006
This commit is contained in:
Tony Flury 2019-05-29 02:36:04 +01:00 committed by Miss Islington (bot)
parent aaed2c332a
commit 09ba83330b
2 changed files with 8 additions and 5 deletions

View File

@ -0,0 +1,2 @@
Clarified Doc string for builtin filter function. 2nd Argument can be any
iterable. Patch by Tony Flury

View File

@ -351,11 +351,12 @@ Fail_arg:
} }
PyDoc_STRVAR(filter_doc, PyDoc_STRVAR(filter_doc,
"filter(function or None, sequence) -> list, tuple, or string\n" "filter(function or None, iterable) -> list, string or tuple\n\
"\n" \n\
"Return those items of sequence for which function(item) is true. If\n" Return a sequence yielding those items of iterable for which function(item)\n\
"function is None, return the items that are true. If sequence is a tuple\n" is true. If function is None, return the items that are true.\n\
"or string, return the same type, else return a list."); If iterable is a string or a tuple, the result also has that type; otherwise\n\
it is always a list.");
static PyObject * static PyObject *
builtin_format(PyObject *self, PyObject *args) builtin_format(PyObject *self, PyObject *args)