itertools.groupby

Steve Howell showell30 at yahoo.com
Mon May 28 18:22:25 EDT 2007


--- Alex Martelli <aleax at mac.com> wrote:

> 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?
> 

Agreed.  

I updated the webpages with your change (after testing
it in 2.5):

http://wiki.python.org/moin/SimplePrograms




       
____________________________________________________________________________________Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 
http://mobile.yahoo.com/go?refer=1GNXIC



More information about the Python-list mailing list