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
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
[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
[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
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