[Tutor] Re: List Comprehensions again

Kirby Urner urnerk@qwest.net
Fri, 25 Jan 2002 10:41:19 -0800


At 11:52 PM 1/24/2002 -0700, Paul Sidorsky wrote:
>Erik Price wrote:
>
> > Where should I look for more info, or is this something that can wait
> > until I am more comfortable with the language?  (I am just finishing
> > tutorials on syntax so you can see that I am really really green at
> > this.)
>
>As should be evident from the debate, neither list comprehensions
>nor map/lambda really make your code any nicer, so it's probably
>not
>critical to learn them any time soon.

I think this syntax often *does* make code nicer and that mastery
of both lambda/map/filter *and* LC is an important step when
learning Python.  I'd agree it can come later, but it should
not be infinitely postponed.  No time like the present.

Also, I don't go along with casting the "debate" in the form of
lambda OR list comprehensions.  We have 'em both, we can use
'em both.

That being said, I agree with Alan that lambda could be made
more powerful, i.e. if it were allowed to contain multiple
statements and such.  But then we'd be doing Scheme.

Kirby