"Sergio Correia" <[EMAIL PROTECTED]> writes: > 2) Reduce > eggs = reduce(lambda x, y: x+y, spam) > > I feel the 1st way is too cumbersome (three lines), and although I > like the 2nd way (except for the lambda part), I understand reduce is > discouraged by Guido so I want to know if there is a "Better Way"(TM) > ?
I thought map/reduce were considered ok again, but the above runs in quadratic time, not good. I'd use: eggs = list(itertools.chain(*spam)) -- http://mail.python.org/mailman/listinfo/python-list