Partially evaluated functions

Rainer Deyke root at rainerdeyke.com
Wed Jun 20 15:08:53 EDT 2001


"Nick Perkins" <nperkins7 at home.com> wrote in message
news:VL5Y6.296349$eK2.60381920 at news4.rdc1.on.home.com...
>
> "Rainer Deyke" <root at rainerdeyke.com> wrote...
>
> > ...
> > My version is superior in that it doesn't use named arguments.
Consider:
> >
> > def f(self):
> >   print self
> >
> > curry(self = 5) # This will fail with the cookbook version.
> >
>
> ..Of course, you mean:
>
> curry(f, self=5)

Yes.

> .. which works fine with the cookbook version.
> ( why wouldn't it? )

Have you tested it?  In Python 2.0:


>>> def f(self, **kwargs):
...   print self, kwargs
...
>>> f(f, self=5)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: keyword parameter redefined: self
>>>


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list