If I create a decorator like the following: def my_decorator(some_fun): def wrapper(): print("before some_fun() is called.") some_fun() print("after some_fun() is called.") return wrapper @my_decorator def just_some_fun(): print("Wheee!") Another decorator can be defined as: def my_decorator(some_fun): print("before some_fun() is called.") some_fun() print("after some_fun() is called.") @my_decorator def just_some_fun(): print("some fun") What is the benefit of using "wrapper" function inside decorator? I didn't understand the purpose. Continue reading...