Question regarding a recent article on informit.com

Cameron Laird claird at lairds.com
Thu Mar 20 07:59:50 EST 2003


In article <gpiea.124425$zo2.3268435 at news2.tin.it>,
Alex Martelli  <aleax at aleax.it> wrote:
>Ben S wrote:
>
>> Jp Calderone wrote:
>>>   Guido has always frowned on the functional elements of Python.
>> 
>> Why is this? Personally I would have thought that the functional
>> elements of Python are an important part of what distinguishes it from
>> being a slightly cleaner version of BASIC? It seems like a lot of sample
>> code I see here and elsewhere uses map, filter, reduce, and lambda, so
>> I'd assumed that these features were a significant part of what
>> attracted people to Python. Maybe I'm wrong? (I'm not exactly an expert
>> in this language.)
>
>What attracts people to Python differs -- but the careful balance
>of elegance and pragmaticity, simplicity and power, high level of
>abstraction yet ease of access to the lower levels at need, is hardly
>affected if one chooses to write, e.g., [x+23 for x in seq if x>0] instead
>of map(lambda x: x+23, filter(lambda x: x>0, seq)), is it now?  From
>my POV the list comprehension is more elegant, more practical, simpler,
>more powerful, AND overall far more Pythonic than the jumble of map,
>lambda and filter you'd have to write in its place -- yet I was very
>strongly attracted to Python even before list comprehensions were
>added to it, so I can't claim this is the key of the attraction!-)
>
>
>Alex
>

... and, let's repeat, list comprehension isn't anti-functional,
it's just a style of functional expression (or can be seen as 
such) which happens to be more Pythonic.
-- 

Cameron Laird <Cameron at Lairds.com>
Business:  http://www.Phaseit.net
Personal:  http://phaseit.net/claird/home.html




More information about the Python-list mailing list