Skip to content

Instantly share code, notes, and snippets.

@Willyfrog
Created November 8, 2013 17:55
Show Gist options
  • Save Willyfrog/7374943 to your computer and use it in GitHub Desktop.
Save Willyfrog/7374943 to your computer and use it in GitHub Desktop.
simple examples of closures ;)
def myitemgetter(*args):
def fun(x):
return tuple([x[v] for v in args])
return fun
def suma_esto(x):
def fun(y):
return x + y
return fun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment