do you master list comprehensions?

Jeremy Bowers jerf at jerf.org
Tue Dec 14 06:30:43 CET 2004


On Tue, 14 Dec 2004 00:41:36 +0100, Max M wrote:

> Fredrik Lundh wrote:
>> Max M wrote:
>> 
>> 
>>>>I tried funnies like [[w for w in L] for L in data],
>>>
>>>That is absolutely correct. It's not a funnie at all.
>> 
>> well, syntactically correct or not, it doesn't do what he want...
> 
> Doh! *I* might not be used to list comprehensions then... You are right.
> 
> That example could have been expressed more clearly as:
> 
>      result = data

result = data[:]

:-)



More information about the Python-list mailing list