4 ms·
While I do sometimes wish Python was even more functional, I don't understand why the author mentions map and filter when those are actually still built in. If
by cup-of-tea 9y ago
While I do sometimes wish Python was even more functional, I don't understand why the author mentions map and filter when those are actually still built in. If you like map and filter then just use them. The lack of a built in identity, compose and reduce is annoying, though.
- icc97 9y agoHe said they were second class citizens not that they didn't exist. They're slower than list comprehension. There was a performance question on SO I remember where the comprehension was 1 or 2 orders of magnitude faster. Edit: Guido wanted to do away with all of map, filter, reduce and lambda in Python 3 [0] [0]: http://www.artima.com/weblogs/viewpost.jsp?thread=98196 http://www.artima.com/weblogs/viewpost.jsp?thread=98196
- dagw 9y agoThere was a performance question on SO I remember where the comprehension was 1 or 2 orders of magnitude faster. That sounds really really weird. The worst I've seen is maybe a factor of 3-4 in some corner cases, largely related to how python does lambdas.
- cup-of-tea 9y agoCan you find a source for the performance difference? I can't imagine why they would be different.