C
contro opinion
def deco(func):
.... def kdeco():
.... print("before myfunc() called.")
.... func()
.... print(" after myfunc() called.")
.... return kdeco
........ def myfunc():
.... print(" myfunc() called.")
....before myfunc() called.
myfunc() called.
after myfunc() called.before myfunc() called.
before myfunc() called.
myfunc() called.
after myfunc() called.
after myfunc() called.
1.
why there are two lines :before myfunc() called.and tow lines :after
myfunc() called. in the output?
2.why the result is not
before myfunc() called.
myfunc() called.
after myfunc() called.
before myfunc() called.
myfunc() called.
after myfunc() called.
.... def kdeco():
.... print("before myfunc() called.")
.... func()
.... print(" after myfunc() called.")
.... return kdeco
........ def myfunc():
.... print(" myfunc() called.")
....before myfunc() called.
myfunc() called.
after myfunc() called.before myfunc() called.
before myfunc() called.
myfunc() called.
after myfunc() called.
after myfunc() called.
1.
why there are two lines :before myfunc() called.and tow lines :after
myfunc() called. in the output?
2.why the result is not
before myfunc() called.
myfunc() called.
after myfunc() called.
before myfunc() called.
myfunc() called.
after myfunc() called.