def tester func None args kwargs def decorator args kwargs print func

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
def tester(func=None, *args, **kwargs):
def decorator(*args, **kwargs):
print func(*args, **kwargs)
if callable(func):
return decorator
else:
def wrapper(func):
def decorator(*args, **kwargs):
print func(*args, **kwargs)
return decorator
return wrapper