--- John Machin <[EMAIL PROTECTED]> wrote: (And you can > > > ignore the fact that > > > it won't find a sequence at the very end of > words, that is fine for my > > > purposes). > > [...] > > Bzzzt. Needs the following code at the end: > if accumulator: > doSomething(accumulator) >
FWIW the OP already conceded that bug, but you're right that it's a common anti-pattern, which is just a nice word for bug. :) The itertools.groupby() function is a well-intended attempt to steer folks away from this anti-pattern, although I think it has usability issues, mostly related to the docs (see other thread). ____________________________________________________________________________________Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online. http://smallbusiness.yahoo.com/webhosting -- http://mail.python.org/mailman/listinfo/python-list