bug with itertools.groupby?

Kitlbast vlad.shevchenko at gmail.com
Wed Oct 7 01:57:30 CEST 2009

Thanks guys!

Miss sorting when reading docs.. (

However, I just create simple "groupby":

def groupby(_list, key_func):
    res = {}
    for i in _list:
        k = key_func(i)
        if k not in res:
            res[k] = [i]
    return res

and it works 3 times faster then itertools.groupby for my example (for
tests I extend number of profiles)

More information about the Python-list mailing list