def trace(func):
def inner(*args, **kwards):
print(func.__name__)
return func(*args, **kwards)
return inner
@trace
def main(x):
print(x)
if __name__ == '__main__':
main(1)
@trace
def main(x):
print(x)
def original_main(x):
print(x)
main = trace(original_main)
def main(*args, **kwards):
print(func.__name__)
return original_main(*args, **kwards)