fork download
  1. class Yoba:
  2. @staticmethod
  3. def foo(f):
  4. print("foo")
  5. def wrapper(*args, **kwargs):
  6. print("wrapper")
  7. f(*args, **kwargs)
  8. return wrapper
  9.  
  10. @Yoba.foo
  11. def bar(self):
  12. Yoba.foo()
  13.  
  14. print(Yoba().foo == Yoba.foo)
  15. Yoba().bar()
Runtime error #stdin #stdout #stderr 0.02s 8736KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 1, in <module>
  File "./prog.py", line 10, in Yoba
NameError: name 'Yoba' is not defined