A trivial question about print

Huaiyu Zhu huaiyu at gauss.almadan.ibm.com
Fri Apr 12 13:41:49 EDT 2002


Alex Martelli <aleax at aleax.it> wrote:

>Personally, I'd rather see curry built-in -- it IS easy to write curry
>in Python 2.2, but it's such a wonderful idiom (and would replace so
>many lambda's;-) that I'd love to see it officially blessed.  Not that
>I expect it to be (and nor will my heart be broken because of this:-).

Do you have in mind a special syntax for curry?  

The implicit syntax (omitting arguments) will interfere with default
arguments and error checking for argument numbers, etc.

What do you think about the following explicit syntax?

def f(a, b, c): return a+b+c
f1 = curry(f, a, b)
f1(c)
map(curry(f, x, y), a)  # map(lambda z:f(x, y, z), a)

Huaiyu



More information about the Python-list mailing list