Skip to content

Instantly share code, notes, and snippets.

@kvendrik
Last active August 29, 2015 14:08
Show Gist options
  • Save kvendrik/11d0c319ed383e9c8300 to your computer and use it in GitHub Desktop.
Save kvendrik/11d0c319ed383e9c8300 to your computer and use it in GitHub Desktop.
Just a simple decorators example
def makeAwesome(sayFunc):
def wrapper(*args):
print sayFunc(args[0]+" are awesome")
return wrapper
@makeAwesome
def say(name):
print name
"""
Equal to: makeAwesome(say), this returns wrapper.
So a call to say is actually wrapper(name)
"""
say("You")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment