Created
January 1, 2012 20:56
-
-
Save peterkeen/1548326 to your computer and use it in GitHub Desktop.
python "anonymous" functions
This file contains 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 some_anonymous_function(arg1, arg2): | |
print "%s %s" % (arg1, arg2) | |
def some_named_function(func, arg1, arg2): | |
func(arg1, arg2) | |
some_named_function(some_anonymous_function, arg1, arg2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment