Max M wrote:

>> I tried funnies like [[w for w in L] for L in data],
>> that is correct syntax, but you'd never guess.
>
> That is absolutely correct. It's not a funnie at all. If you find it odd it's 
> only because you are 
> not used to list comprehensiones.

well, syntactically correct or not, it doesn't do what he want...

> In that case you might be more comfortable with:
>
> data = [['foo','bar','baz'],['my','your'],['holy','grail']]
> result = []
> for l in data:
>     result += l

how about (slightly evil):

    result = []; map(result.extend, data)

</F> 



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

Reply via email to