Created
November 8, 2013 17:55
-
-
Save Willyfrog/7374943 to your computer and use it in GitHub Desktop.
simple examples of closures ;)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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