I'm talking about in function c, where we bind the function call, kinda same
thing with lambdas too, exactly same

def func1(a):
    return a
def func2(a="",b=0):
    return "%s has %d apples"%(a,b)
def c(f1,f2,**kwargs):
    print f2(kwargs['name'], f1(kwargs['apple'])) #bind call to function 1
and return from a bound function 2

bollox=42
>>> d={bollox: (c,(func1,func2)} # call c, which is bound, passing in func1
and func2 unbound, function pointer
>>> print d[bollox][0](func1,func2,name="fred flinstone",apple=bollox)
fred flinstone has 42 apples

-Alex Goretoy
http://www.goretoy.com

Fred Allen  - "The first time I sang in the church choir; two hundred people
changed their religion."
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to