Created
May 18, 2014 11:44
-
-
Save svlasov/faf38b7292c63e5e620b to your computer and use it in GitHub Desktop.
Parameterized decorator
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 decoratorFunctionWithArguments(arg1, arg2, arg3): | |
def wrap(f): | |
print "Inside wrap()" | |
def wrapped_f(*args): | |
print "Inside wrapped_f()" | |
print "Decorator arguments:", arg1, arg2, arg3 | |
f(*args) | |
print "After f(*args)" | |
return wrapped_f | |
return wrap |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment