array of class

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Thu Jan 4 05:22:19 EST 2007


Podi a écrit :
>>>Or more compactly:
>>>
>>>words = [Word(w) for w in 'this is probably what you want'.split()]
>>>print words
>>
>>I didn't want to introduce yet some more "confusing" stuff !-)
> 
> 
> Indeed, the for loop is perfectly fine and totally readable. Let's save
> the "confusing stuff" to the Perl folks.
> 

This is not what I meant. I do like list comprehensions and use them a 
lot - and I don't find anything "perlish" here.



More information about the Python-list mailing list