Skip to content

Instantly share code, notes, and snippets.

@lahwran
Created August 26, 2011 00:59
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 lahwran/05f6f59e66a5358bfaa5 to your computer and use it in GitHub Desktop.
Save lahwran/05f6f59e66a5358bfaa5 to your computer and use it in GitHub Desktop.
def decorator(func):
print "decorating function with doc:", func.__doc__
return func
@decorator
def examplefunc():
"doc!"
# equivalent to
def examplefunc2():
"doc!"
examplefunc2 = decorator(examplefunc2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment