Created
August 3, 2011 17:11
-
-
Save wess/1123174 to your computer and use it in GitHub Desktop.
example python decorator
This file contains hidden or 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
def decorator_here(func): | |
def wrapper(func): | |
x = func() | |
return "%s , goodbye world" | |
return wrapper | |
@decorator_here | |
def testing(): | |
return "hello world" | |
if __name__ == "__main__": | |
testing() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment