itertools.groupby

Raymond Hettinger python at rcn.com
Mon May 28 16:02:12 EDT 2007


> > That's not for everyone, so it isn't a loss if
> > someone sticks
> > with writing plain, clear everyday Python instead of
> > an itertool.
>
> I know most of the module is fairly advanced, and that
> average users can mostly avoid it, but this is a very
> common-antipattern that groupby() solves:

I think the OP would have been better-off with plain
vanilla Python such as:

   See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/259173

Raymond




More information about the Python-list mailing list