Skip to content

Instantly share code, notes, and snippets.

@suminb
Created April 26, 2015 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suminb/67d6b25de28dc557af33 to your computer and use it in GitHub Desktop.
Save suminb/67d6b25de28dc557af33 to your computer and use it in GitHub Desktop.
Test of currying in Python (written in Oct 12, 2010; found from a backup archive on Apr 26, 2015)
def f(n):
def g(m):
def h(s):
return m + n + s
return h
return g
a = f(1)(2)
print a
print a(3)
b = f(1)
print b(10)(20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment