Created
June 4, 2009 15:46
-
-
Save hntrmrrs/123677 to your computer and use it in GitHub Desktop.
OMG I forgot the return statement...
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 baz(f): | |
def wrapper(*args, **kwargs): | |
print 'Calling wrapper...' | |
return f(*args, **kwargs) | |
return wrapper | |
class Foo(object): | |
def __init__(self, i): | |
self._i = i | |
@property | |
@baz | |
def i(self): | |
return self._i | |
if __name__ == '__main__': | |
f = Foo(100) | |
print f.i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment