[Python-Dev] Distutils using apply

Guido van Rossum guido@python.org
Mon, 05 May 2003 08:02:08 -0400


> Could someone please explain why apply() was marked deprecated ?

Becase it's more readable, more efficient, and more flexible to write
f(x, y, *t) than apply(f, (x, y) + t).

> The only reference I can find is in PEP 290 and that merely
> reports this "fact".
> 
> I'm -1 on deprecating apply(). Not only because it introduces yet
> another incompatiblity between Python versions, but also because it
> is still useful in the context of having a function which mimics
> a function call, e.g. for map() and other instance where you
> pass around functions as operators.

Then maybe we should add something like operator.__call__.

OTOH, you're lucky that map isn't deprecated yet in favor of list
comprehensions; I expect that Python 3.0 won't have map or filter
either.

--Guido van Rossum (home page: http://www.python.org/~guido/)