Skip to content

Instantly share code, notes, and snippets.

@rahulkp220
Created June 26, 2016 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahulkp220/95d26a20fde2b154502b196845efd07f to your computer and use it in GitHub Desktop.
Save rahulkp220/95d26a20fde2b154502b196845efd07f to your computer and use it in GitHub Desktop.
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