flatten a list of list

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Sun Aug 16 07:31:57 EDT 2009


On Sun, 16 Aug 2009 06:59:52 -0400, Chris Rebert wrote:

>> Surely that's going to be O(N**2)?
> 
> The OP asked for "simple", not "best", "most proper", or "fastest". My
> comment was intended to mean that the code was marginally *simpler*, not
> faster.

Fair enough, but he also asked for Pythonic, and while some people might 
argue that "terrible performance" is Pythonic, I hope you wouldn't be one 
of them! :)

If it soothes your ruffled sense of honour *wink*, I think your solution 
with itertools.chain is probably the best so far.


-- 
Steven



More information about the Python-list mailing list