[docs] [issue27385] itertools.groupby has misleading doc string
report at bugs.python.org
Tue Jun 28 10:42:50 EDT 2016
Josh Rosenberg added the comment:
While you're fixing, the docstring should say "groupby(iterable, key=None)", not "groupby(iterable[, keyfunc])"; the functions accepts the key function by name, and the name is key, not keyfunc. And it can be passed explicitly as None (equivalent to not passing it at all), so the [, keyfunc] approach that indicates it's positional only and can't be explicitly passed as a default is wrong. Gets a little confusing because it also returns a "key", but the argument is definitely named "key", so we can't go calling it "keyfunc".
Mind you, seems like this could also be fixed by just Clinic-ifying it.
Python tracker <report at bugs.python.org>
More information about the docs