itertools.groupby

Alex Martelli aleax at mac.com
Mon May 28 17:12:32 EDT 2007


Steve Howell <showell30 at yahoo.com> wrote:
   ...
> for has_chars, frags in itertools.groupby(lines,
> lambda x: len(x) > 0):

Hmmm, it appears to me that itertools.groupby(lines, bool) should do
just the same job, just a bit faster and simpler, no?


Alex



More information about the Python-list mailing list