Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Python: currying

Name: Anonymous 2010-04-29 9:40

Suppose we have an implementation of Python in which functions support currying. We write:


def f(x, y, z):
    print(x, y, z)

f(y=2)(1)(3)


What output will be generated?

Name: Anonymous 2010-04-30 14:58

>>22
Yes, because it was specifically added as an exception to the usual syntax, when it could just elegantly be a consequence of the way things should work anyway. Python's artificial and useless distinctions between expressions and statements is a conceptual eyesore.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List