[Tutor] Apply()

Erik Price erikprice@mac.com
Wed Feb 5 22:19:02 2003


On Wednesday, February 5, 2003, at 01:49  PM, Bob Gailer wrote:

> Mechanics: apply(function, sequence-of-positional-parameters, 
> mapping-of-named-parameters)
>
> This lets you write code that calls an arbitrary function with 
> arbitrary parameters. Say you create a set of functions; they all 
> expect the same parameters; they do different things. It is only at 
> execution time that the program chooses one of these based on some 
> conditions. Instead of a series of if ... elif statements you use 
> apply to "apply" the chosen function to the arguments.

That's nifty ... thanks for explaining.  But I don't see it in the 
index of the Python docs on the web site.  Is that something that isn't 
in Python yet, or... ?


Erik




-- 
Erik Price

email: erikprice@mac.com
jabber: erikprice@jabber.org