Created
June 9, 2013 11:26
-
-
Save saurabh-hirani/5743232 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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