kuroko/test/testDecoratedRecursiveFunction.krk

19 lines
260 B
Python
Raw Normal View History

def decorate(func):
def _inner(a):
print('in')
a = func(a)
print('out')
return a
return _inner
def foo():
@decorate
def bar(a):
if a <= 0:
return 0
return bar(a-1)
bar(2)
foo()