fork download
  1. def decor(fn):
  2. def wrapper(*args, **kwargs):
  3. print('start')
  4. res = fn(*args, **kwargs)
  5. print('finish')
  6. return res
  7. return wrapper
  8.  
  9. @decor
  10. def summ(x, y):
  11. return x+y
  12.  
  13. r = decor(summ(2, 4))
  14.  
  15. print(r)# your code goes here
Success #stdin #stdout 0.01s 7296KB
stdin
Standard input is empty
stdout
start
finish
<function wrapper at 0x154e5e58b7d0>