map is useless!

Thomas Jollans thomas at jollans.com
Sun Jun 6 15:35:31 EDT 2010


On 06/06/2010 05:16 PM, rantingrick wrote:
> So can anyone explain this poor excuse for a map function? Maybe GVR
> should have taken it out in 3.0?  *scratches head*
>
>   
Speaking of Py3k: map no longer builds lists. What once was map is no
more, what once was itertools.imap is now map.

Sometimes Py2.x map is useful, sometimes list comprehension is nicer.
Sometimes Py3.x map / Py2.x itertools.imap is useful, sometimes
generator expressions are more elegant.



Same goes for filter, by the way.




More information about the Python-list mailing list