diff options
author | Tony Flury <anthony.flury@btinternet.com> | 2019-05-29 01:36:04 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-05-29 01:36:04 (GMT) |
commit | 09ba83330b495afedbb6b27853506fe15a85b461 (patch) | |
tree | 68a15b78027f129ec6fc3a2991d714a4082a46ef | |
parent | aaed2c332ae8370e5e87d09c43ef7a39c2abf68d (diff) | |
download | cpython-09ba83330b495afedbb6b27853506fe15a85b461.zip cpython-09ba83330b495afedbb6b27853506fe15a85b461.tar.gz cpython-09ba83330b495afedbb6b27853506fe15a85b461.tar.bz2 |
[2.7] bpo-33006 - Correct filter doc string to clarify 2nd argument can be iterable (GH-6015)
https://bugs.python.org/issue33006
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2018-03-07-09-10-42.bpo-33006.Bzx3LA.rst | 2 | ||||
-rw-r--r-- | Python/bltinmodule.c | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-03-07-09-10-42.bpo-33006.Bzx3LA.rst b/Misc/NEWS.d/next/Core and Builtins/2018-03-07-09-10-42.bpo-33006.Bzx3LA.rst new file mode 100644 index 0000000..0bcc0a4 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2018-03-07-09-10-42.bpo-33006.Bzx3LA.rst @@ -0,0 +1,2 @@ +Clarified Doc string for builtin filter function. 2nd Argument can be any +iterable. Patch by Tony Flury diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 4b819da..6d47de1 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -351,11 +351,12 @@ Fail_arg: } PyDoc_STRVAR(filter_doc, -"filter(function or None, sequence) -> list, tuple, or string\n" -"\n" -"Return those items of sequence for which function(item) is true. If\n" -"function is None, return the items that are true. If sequence is a tuple\n" -"or string, return the same type, else return a list."); +"filter(function or None, iterable) -> list, string or tuple\n\ +\n\ +Return a sequence yielding those items of iterable for which function(item)\n\ +is true. If function is None, return the items that are true.\n\ +If iterable is a string or a tuple, the result also has that type; otherwise\n\ +it is always a list."); static PyObject * builtin_format(PyObject *self, PyObject *args) |