Thread
:
The Demise of lambda, map, filter and reduce
View Single Post
Feb 3rd, 2006, 3:46 PM
#
11
Arevos
Programming Guru
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power:
5
But, on the other hand:
(
Toggle Plain Text
)
[i * i for i in l if i % 2 == 0]
[i * i for i in l if i % 2 == 0]
is more pleasant than
(
Toggle Plain Text
)
map(lambda x : x * x, filter(lambda x : x % 2 == 0, l))
map(lambda x : x * x, filter(lambda x : x % 2 == 0, l))
Not that it's hard to create map and filter functions yourself, if you really want to
Arevos
View Public Profile
Visit Arevos's homepage!
Find More Posts by Arevos