list comprehension

Simon Forman rogue_pedro at yahoo.com
Fri Jun 30 21:45:42 EDT 2006


Bruno Desthuilliers wrote:
> Andy Dingley <dingbat at codesmiths.com> wrote:
> > Simon Forman wrote:
> >
> >>There's more to it, but that's the basic idea.
> >
> > This much I knew, but _why_ and _when_ would I choose to use list
> > comprehension (for good Python style), rather than using a simple
> > "traditional" loop ?
> 
> Whenever it's more readable.
> 

Yeah.  Also, it's faster.

~Simon




More information about the Python-list mailing list