a break for comprehensions

Tom Jenkins tjenkins at nospiced.ham.devis.com
Fri Jul 27 14:13:44 EDT 2001


phawkins at connact.com wrote:

>>>>>>"PH" == Peter Hansen <peter at engcorp.com> writes:
>>>>>>
> 
> PH> In my post I was attempting to point out that I find list 
> PH> comprehensions less readable than the equivalent, longer but 
> PH> more explicit while loop version, not that one list comprehension 
> PH> is more or less cryptic than another.
> 
> Personally, as soon as I saw list comprehensions, I found them
> splendidly, instantly readable -- so long as they aren't nested, I can
> read them at a glance, where it takes me just a little longer to
> comprehend all of a loop.  This is certainly true for the examples
> we've been looking at.  So I think this just has to do with how one's
> mind works.


I couldn't read list comprehensions until I actually started playing 
around with them.  After experimenting and writing (oh about 3 or 4) I 
discovered I could read them ;)

> 
> and-no-I-don't-find-perl-at-all-readable-ly yr's
> Patricia
> 

and-i-don't-find-lisp-readable-either-although-with-list-comprehensions-i'm-starting-to-ly 
yours
Tom




More information about the Python-list mailing list