[Python-ideas] sequence.apply(function)

Ned Batchelder ned at nedbatchelder.com
Sat Sep 1 14:00:21 CEST 2012


On 9/1/2012 2:29 AM, anatoly techtonik wrote:
> Idea: Apply function to every element of a sequence and return new
> sequence. It's more pythonic than map(), because clearly works only as
> a list method.

Python 2 has itertools.imap, and Python 3 has map, both of which do 
exactly what you want.

--Ned.
> --
> anatoly t.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>




More information about the Python-ideas mailing list