[Python-ideas] sequence.apply(function)

Guido van Rossum guido at python.org
Sat Sep 1 19:06:48 CEST 2012


On Sat, Sep 1, 2012 at 8:29 AM, anatoly techtonik <techtonik at gmail.com> 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.

It's less Pythonic, because every sequence-like type (not just list)
would have to reimplement it.

Similar things get proposed for iterators (e.g. it1 + it2, it[:n],
it[n:]) regularly and they are (and should be) rejected for the same
reason.

-- 
--Guido van Rossum (python.org/~guido)



More information about the Python-ideas mailing list