general question about PEP reasoning

jerf at compy.attbi.com jerf at compy.attbi.com
Mon Feb 10 22:09:24 EST 2003


On Mon, 10 Feb 2003 21:42:57 +0000, Peter Harris wrote:
> class closure(object):
>      __slots__=('fn','args','kw')
>      def __init__(self, fn, *args, **kw):
>          self.fn, self.args, self.kw = (fn, args, kw)
> 
>      def __call__(self, *args, **kw):
>          d = self.kw.copy()
>          d.update(kw)
>          return self.fn(*(self.args + args), **d)

A general question, and I mean no disrespect by it. Why propose a PEP that
can be implemented today in 9 lines of Python? I've got two or three
versions of this idea floating around in my code base already, thanks to
the find curry writeup in the ASPN Cookbook. (In one hairy case I wanted
to be able to curry on either the first or second argument independently.)

A cookbook recipe seems a much better place to put this sort of thing. Am
I missing something?

Again, this is an honest question, not intended as a sarcastic comment.




More information about the Python-list mailing list