[Python-ideas] Syntax for curried functions

Scott David Daniels Scott.Daniels at Acm.Org
Mon Mar 2 18:05:54 CET 2009


Weeble wrote:
> Would this be crazy? Make this:
> 
> def spam(a,b,c)(d,e,f):
>     [BODY]
> 
> a synonym for:
> 
> def spam(a,b,c):
>     def spam2(d,e,f):
>         [BODY]
>     return spam2

What advantage does this style have over:

     def spam(a, b, c, d, e, f):
         [BODY]

     spam3 = functools.partial(spam, 'initial', 'three', 'args')

--Scott David Daniels
Scott.Daniels at Acm.Org




More information about the Python-ideas mailing list