我想在定義裝飾器時禁止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’應該有自身作爲第一個參數
我定義一個類裏面的裝飾,所以這是隻有這樣,它的正常工作。
感謝
您定義的類中的裝飾?爲什麼? –