Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Add Comment
Please, Sign In to add comment