--- Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > > 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 >
That recipe implements SQL-like Group By, but it's the uniq-like reimplementation of groupby() that I think is error prone. The OP was writing code that wanted the uniq-like semantics. ____________________________________________________________________________________Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games. http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow -- http://mail.python.org/mailman/listinfo/python-list