5 ms·
> "though map, and filter aren't 'Pythonic' anymore" How come? I must have missed the memo...
by nuclear_eclipse 18y ago
> "though map, and filter aren't 'Pythonic' anymore"
How come? I must have missed the memo...
- apgwoz 18y agolist comprehensions take care of them. Guido wanted to remove them from Python 3. map = lambda f, a: [f(x) for x in a] filter = lambda f, a: [x for x in a if f(x)]
- nuclear_eclipse 18y agoMakes sense; thank you for the explanation.
- sciolizer 18y agoList comprehensions cover 90% of the use cases, but I'm glad map and filter were not removed. List comprehensions do not have first class status. You can pass map and filter around as arguments to other functions, but you cannot pass around "for", "in", and "if".
- apgwoz 18y agoYou're right, but even if they were removed, see above for their definition. :)