Paul Hughett wrote:
Hey, if we'll killing off builtins, I vote for apply().
Agreed, it's redundant. You can help by checking in documentation that marks it as deprecated and code that adds a PendingDeprecationWarning to it (unfortunately it's so common that I wouldn't want to risk a plain DeprecationWarning).
You've lost me here. I've recently written a piece of code that uses a lookup table on the name of a file to find the right function to apply to it; if I don't use apply for this, what should I use? An explicit case statement cannot be dynamically modified; using eval() requires a conversion to string (and is arguably even uglier than apply).
Since a function is a first class callable object, you just pick it out of your lookup table func = look[key] and call it with the args and kwds which you got, using the new asterisk syntax: ret = func(*args, **kwds)
ciao - chris