Message220639
The name of the 2nd parameter to itertools.groupby() is documented inconsitently. Sometimes it's "key", sometimes "keyfunc". The code actually uses "key", so I adapted all occurences I found to "key".
>>> from itertools import groupby
>>> groupby.__doc__
'groupby(iterable[, keyfunc]) -> create an iterator which returns\n(key, sub-iterator) grouped by each value of key(value).\n'
>>> groupby([], keyfunc=lambda x: x)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'keyfunc' is an invalid keyword argument for this function
>>> groupby([], key=lambda x: x)
<itertools.groupby object at 0x7fee025d2048> |
|
Date |
User |
Action |
Args |
2014-06-15 14:07:16 | ukl | set | recipients:
+ ukl, docs@python |
2014-06-15 14:07:16 | ukl | set | messageid: <1402841236.86.0.756808540729.issue21771@psf.upfronthosting.co.za> |
2014-06-15 14:07:16 | ukl | link | issue21771 messages |
2014-06-15 14:07:16 | ukl | create | |
|