diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2017-09-25 08:41:49 (GMT) |
---|---|---|
committer | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2017-09-25 08:41:49 (GMT) |
commit | e2a30cd35b95dad55aea10347655f246348d1951 (patch) | |
tree | 34c20febf34858561dbdccced9c255bac8731054 /Modules | |
parent | 73c915a5cd1cdd8775cf47b77fef7ca8fd42ad96 (diff) | |
download | cpython-e2a30cd35b95dad55aea10347655f246348d1951.zip cpython-e2a30cd35b95dad55aea10347655f246348d1951.tar.gz cpython-e2a30cd35b95dad55aea10347655f246348d1951.tar.bz2 |
[3.6] bpo-27385: Clarify docstring for groupby() (GH-3738) (#3744)
(cherry picked from commit 49392c63a243052c8013bef80d35202bb6d7c404)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/itertoolsmodule.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index 8e22ec9..21c0e82 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -174,8 +174,9 @@ static PyMethodDef groupby_methods[] = { }; PyDoc_STRVAR(groupby_doc, -"groupby(iterable[, keyfunc]) -> create an iterator which returns\n\ -(key, sub-iterator) grouped by each value of key(value).\n"); +"groupby(iterable, key=None) -> make an iterator that returns consecutive\n\ +keys and groups from the iterable. If the key function is not specified or\n\ +is None, the element itself is used for grouping.\n"); static PyTypeObject groupby_type = { PyVarObject_HEAD_INIT(NULL, 0) |