def _dec(f): def wrapper(): v = 1 f() return wrapper @_dec def f(): print('one: ', v) f()
Standard input is empty
Standard output is empty
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