Skip to content

Instantly share code, notes, and snippets.

@seantalts
Created April 23, 2013 15:30
Show Gist options
  • Save seantalts/5444568 to your computer and use it in GitHub Desktop.
Save seantalts/5444568 to your computer and use it in GitHub Desktop.
>>> def greets(function):
... def greets_wrapper(*args, **kwargs):
... print "hi there, ", function
... return function(*args, **kwargs)
... return greets_wrapper
...
>>> @greets
... def add(num1, num2):
... return num1 + num2
...
>>> add(1, 2)
hi there, <function add at 0x109da2aa0>
3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment