Re: "For" loop and list comprehension similarity
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: "For" loop and list comprehension similarity

From: <s.lipnevich@gmail.com>
Date: Mon Mar 27 2006 - 01:14:30 CEST

> Why not combine the two:

I guess because (at least in source code) you're doing a loop twice
:-). I don't know what a compiler would do. I think though that the
"for i in c if test:" construct is more readable and maybe can even be
better optimized.
Thanks!

Sergey.
Received on Sun Apr 30 21:15:47 2006