我正在尝试在 python 中使用此代码:
class A:
func = lambda: "go away"
@classmethod
def apply(cls):
cls.func()
A.apply()
我收到这个错误:
unbound method <lambda>() must be called with A instance as first argument (got nothing instead)
我怎样才能让它工作?