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 15:21

>>23
It's not an "exception", it's a part of the syntax.
http://docs.python.org/reference/simple_stmts.html#assignment-statements
Namely, this:
(target_list "=")+

If you're fighting with the language on intentional and rational parts of the syntax, maybe instead of bitching about it you should go use another language instead. Ruby might be more your thing, if you're into slow-as-fuck languages.

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