fork download
  1. def _dec(f):
  2. def wrapper():
  3. v = 1
  4. f()
  5. return wrapper
  6.  
  7. @_dec
  8. def f():
  9. print('one: ', v)
  10.  
  11. f()
  12.  
  13.  
Runtime error #stdin #stdout #stderr 0.02s 8688KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 11, in <module>
  File "./prog.py", line 4, in wrapper
  File "./prog.py", line 9, in f
NameError: name 'v' is not defined