this example shows how to use a decorator to add functionality to a function >>> def decorator(f): ... def inner(): ... print('before') ... retval = f() ...
確定! 回上一頁