Skip to content

Instantly share code, notes, and snippets.

@hntrmrrs
Created June 4, 2009 15:46
Show Gist options
  • Save hntrmrrs/123677 to your computer and use it in GitHub Desktop.
Save hntrmrrs/123677 to your computer and use it in GitHub Desktop.
OMG I forgot the return statement...
#!/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