Re: binding more than one attribute in a facntion

2006-07-26 Thread [EMAIL PROTECTED]
Peter Otten wrote: > [EMAIL PROTECTED] wrote: > Bound methods are limited to one implicit parameter. What you need is > partial function application: > > >>> def f(a, b, c): > ... return a + b + c > ... > >>> def partial(f, *args): > ... def g(*more): > ... return f(*args+more

Re: binding more than one attribute in a facntion

2006-07-26 Thread faulkner
http://cheeseshop.python.org/pypi/functional learn lisp/scheme! http://cs.wwc.edu/KU/PR/Scheme.html Peter Otten wrote: > [EMAIL PROTECTED] wrote: > > > I want to have a bound method that "fixes" more than one parmeter of a > > funtion. LEt me post an example. > > > > def f(a, b, c): > > retu

Re: binding more than one attribute in a facntion

2006-07-26 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I want to have a bound method that "fixes" more than one parmeter of a > funtion. LEt me post an example. > > def f(a, b, c): > return a + b + c > > I can do: > fplus10 = f(10) > and then call f with 2 params and it works. > > But, how can I fix 2 params: > fplus1

Re: binding more than one attribute in a facntion

2006-07-26 Thread bearophileHUGS
[EMAIL PROTECTED]: > def f(a, b, c): return a + b + c > I can do: > fplus10 = f(10) > and then call f with 2 params and it works. If you call that f or that fplus10 with two parameters you obtain an error in both cases. You have an error with the f(10) line too. With Python 2.5 you can probably u

binding more than one attribute in a facntion

2006-07-26 Thread [EMAIL PROTECTED]
I want to have a bound method that "fixes" more than one parmeter of a funtion. LEt me post an example. def f(a, b, c): return a + b + c I can do: fplus10 = f(10) and then call f with 2 params and it works. But, how can I fix 2 params: fplus10plus20 = f(10,20) ignores the second param. fplu