You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

15 lines
243 B

class ClassDeco:
def __init__(self, f):
self.f = f
def __call__(self, *args, **kwargs):
print(self.f, args, kwargs)
return self.f(*args, **kwargs)
@ClassDeco
def foo():
return 45
# foo = ClassDeco(foo)