mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-17 01:51:39 +09:00
17 lines
197 B
Python
17 lines
197 B
Python
|
|
def logged(f):
|
|
def wrapper(a, b):
|
|
print('Calling function', f)
|
|
return f(a, b + 1)
|
|
return wrapper
|
|
|
|
|
|
@logged
|
|
def add(a, b):
|
|
return a + b
|
|
|
|
c = add(10, 3)
|
|
|
|
assert c == 14
|
|
|