equivalent functions?

Lonnie Princehouse finite.automaton at gmail.com
Fri Feb 10 20:47:50 EST 2006


Very close... it is equivalent to:

    apply_each = lambda fns, args=[]: [f(*args) for f in fns]

The asterisk in f(*args) expands the sequence to fill the arguments to
f, where as f(args) would pass the args as only the first argument to
the function.

apply is deprecated, replaced by the syntax:  function( *args,
**keywords )




More information about the Python-list mailing list