3 ms·
> Generators and comprehensions completely removed the need for those, yet the functions remain even in Python 3. Hmm, I had never thought about it like that.
by fao_ 10y ago
> Generators and comprehensions completely removed the need for those, yet the functions remain even in Python 3.
Hmm, I had never thought about it like that.
Are there any articles, etc. you recommend about the differences or the advantages of one method over the other? It'd be nice to look into this more.
- nomel 10y agoI don't think you'll find one. Guido wanted to remove them [1], but people wanted them to stay for some reason. There is no difference between `map(func, values)` and `[func(x) for x in values]`, except for character count. [1] http://www.artima.com/weblogs/viewpost.jsp?thread=98196 http://www.artima.com/weblogs/viewpost.jsp?thread=98196