Re: i can't understand decorator
Am 15.01.2013 15:20 schrieb contro opinion: >>> def deco(func): ... def kdeco(): ... print("before myfunc() called.") ... func() ... print(" after myfunc() called.") ... return kdeco ... >>> @deco ... def myfunc(): ... print(" myfunc() called.") ...
Re: i can't understand decorator
On 15 January 2013 14:20, contro opinion wrote: def deco(func): > ... def kdeco(): > ... print("before myfunc() called.") > ... func() > ... print(" after myfunc() called.") > ... return kdeco > ... @deco > ... def myfunc(): > ... print(" myfunc