Created
June 26, 2016 15:18
-
-
Save rahulkp220/95d26a20fde2b154502b196845efd07f 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 multiply(by = None): | |
def multiply_real_decorator(function): | |
def wrapper(*args,**kwargs): | |
return by * function(*args,**kwargs) | |
return wrapper | |
return multiply_real_decorator | |
@multiply(by = 3) | |
def adder(a,b): | |
return a + b | |
print adder(2,3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment