Re: i can't understand decorator

2013-01-15 Thread Thomas Rachel
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

2013-01-15 Thread Oscar Benjamin
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