Robin Becker wrote: > Paul Rubin wrote: > > Paul Rubin <http://[EMAIL PROTECTED]> writes: > > > >>>>>import operator > >>>>>a=[(1,2),(3,4),(5,6)] > >>>>>reduce(operator.add,a) > >> > >>(1, 2, 3, 4, 5, 6) > > > > > > (Note that the above is probably terrible if the lists are large and > > you're after speed.) > yes, and it is all in C and so could be a contender for the speed champ. > I guess what you're saying is that it's doing > That is what I thought too but seems that [x for pair in li for x in pair] is the fastest on my machine and what is even stranger is that if I use psyco.full(), I got a 10x speed up for this solution(list comprehension) which is head and shoulder above all the other suggested so far.
-- http://mail.python.org/mailman/listinfo/python-list