Skip to content

Instantly share code, notes, and snippets.

@BolajiOlajide
Created August 14, 2017 03:19
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 BolajiOlajide/bd2d10cdf4311522260e346aca80d241 to your computer and use it in GitHub Desktop.
Save BolajiOlajide/bd2d10cdf4311522260e346aca80d241 to your computer and use it in GitHub Desktop.
Simple decorator
def print_method_type(f):
def decorated(*args, **kwargs):
print f, type(f)
return f(*args, **kwargs)
return decorated
@print_method_type
def add(x,y):
return x + y
add(2,3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment