diff options
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2017-09-25 08:21:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-25 08:21:06 (GMT) |
commit | 49392c63a243052c8013bef80d35202bb6d7c404 (patch) | |
tree | 88cc922963f21d36e2992feb3b9d6561dfc2dc52 /Modules | |
parent | 57c2561c8c5663aef55b00e3f29cba575ff36ccd (diff) | |
download | cpython-49392c63a243052c8013bef80d35202bb6d7c404.zip cpython-49392c63a243052c8013bef80d35202bb6d7c404.tar.gz cpython-49392c63a243052c8013bef80d35202bb6d7c404.tar.bz2 |
bpo-27385: Clarify docstring for groupby() (#3738)
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 2ac5ab2..cc9895a 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -176,8 +176,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) |