我想在定义装饰器时禁止Eclipse警告。禁止在使用Pydev进行开发时使用Eclipse
例如:
def tool_wrapper(func):
def inner(self):
cmd="test"
cmd+=func(self)
return inner
@tool_wrapper
def list_peer(self):
return "testing "
我得到一个装饰定义警告: “方法‘tool_wrapper’应该有自身作为第一个参数
我定义一个类里面的装饰,所以这是只有这样,它的正常工作。
感谢
您定义的类中的装饰?为什么? –