Skip to content

Instantly share code, notes, and snippets.

@saurabh-hirani
Created June 9, 2013 11:26
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 saurabh-hirani/5743232 to your computer and use it in GitHub Desktop.
Save saurabh-hirani/5743232 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
def decorator_factory():
def decorator(func):
def decorator_wrapper():
print "Decorator calling func"
func()
print "Decorator called func"
return decorator_wrapper
return decorator
@decorator_factory()
def func():
print "In the function"
func()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment