I have a following small Python program:
def wrap(func):
print "before execution ..."
a = func()
print "after execution ..."
return a
@wrap
def dosomething():
print "doing something ..."
When I execute above script I should not get any output as I am not calling:
dosomething()
But when I execute this script I get the following output:
before execution ...
doing something ...
after execution ...
Please explain the reason for this behavior