Created
June 7, 2013 08:17
-
-
Save jdswinbank/5727783 to your computer and use it in GitHub Desktop.
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 factory_function(): | |
default_par = "something" | |
default_foo = "something else" | |
def returned_function(x, par=default_par, foo=default_foo): | |
print "x is " + str(x) | |
print "par is " + str(par) | |
print "foo is " + str(foo) | |
return returned_function | |
fn = factory_function() | |
fn("x") | |
fn("x", "y", "z") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment