Created
October 6, 2008 14:07
-
-
Save trek/15044 to your computer and use it in GitHub Desktop.
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
| class Foo(object): | |
| def __init__(self,arg): | |
| """docstring for __init__""" | |
| self.arg = arg | |
| def dec(fn): | |
| def wrapper(*args): | |
| # args[0] is self. Lame | |
| args[0].arg = 'not what you thought, huh?' | |
| return fn(*args) | |
| return wrapper | |
| @dec | |
| def bar(self): | |
| """docstring for bar""" | |
| return self.arg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment