(self, seq, key=lambda x:x)
| 1 | class groupby(dict): |
| 2 | def __init__(self, seq, key=lambda x:x): |
| 3 | for value in seq: |
| 4 | k = key(value) |
| 5 | self.setdefault(k, []).append(value) |
| 6 | __iter__ = dict.iteritems |
| 7 | |
| 8 | # -------------------------- Examples ----------------------------------- |
nothing calls this directly
no test coverage detected