Alex Martelli wrote:
> Using sum on lists is DEFINITELY slow -- avoid it like the plague.
> 
> If you have a list of lists LOL, DON'T use sum(LOL, []), but rather
> 
> [x for x in y for y in LOL]

Should be
 >>> lol = [[1,2],[3,4]]
 >>> [x for y in lol for x in y]
[1, 2, 3, 4]

The outer loop comes first.

Kent
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to