itertools.groupby
Carsten Haese
carsten at uniqsys.com
Mon May 28 23:36:02 EDT 2007
On Mon, 28 May 2007 23:02:31 -0400, Gordon Airporte wrote
> '''
> class groupby(__builtin__.object)
> | groupby(iterable[, keyfunc]) -> create an iterator which returns
> | (key, sub-iterator) grouped by each value of key(value).
> |
> '''
>
> "Each" seems to imply uniqueness here.
Yes, I can see how somebody might read it this way.
How about "...grouped by contiguous runs of key(value)" instead? And while
we're at it, it probably should be keyfunc(value), not key(value).
--
Carsten Haese
http://informixdb.sourceforge.net
More information about the Python-list
mailing list