Last active
August 29, 2015 14:22
-
-
Save jrosco/67c83d9b29612b0891ad to your computer and use it in GitHub Desktop.
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 outsideFunc(Func): | |
def one(*args, **kwargs): | |
print Func(*args, **kwargs) | |
def two(*args, **kwargs): | |
print Func(*args, **kwargs) | |
def nothing(*args, **kwargs): | |
print Func(*args, **kwargs) | |
if Func.__name__ is "do_one": | |
return one | |
elif Func.__name__ is "do_two": | |
return two | |
else: | |
return nothing | |
@outsideFunc | |
def do_one(*args, **kwargs): | |
return args, kwargs | |
@outsideFunc | |
def do_two(*args, **kwargs): | |
return args, kwargs | |
@outsideFunc | |
def do_nothing(*args, **kwargs): | |
return args, kwargs | |
do_nothing('nothing') | |
do_one("foo", "2015", "test", foobar = 20, testing = 'Nothing') | |
do_two("bar", 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment