關於 pylint 的 *E1101* 錯誤:
概念:
1 %s %r has no %r member 2 3 Function %r has no %r member 4 Variable %r has no %r member 5 . . .
描述:
在訪問一個對象(變量,函數,....)中不存在的成員時會出現這個錯誤。
誤報:在當報錯的對象是動態創建的,並且確實是在訪問的同時已經存在的時候pylint仍然會報出E1101的錯誤
解決辦法
在代碼的開頭加上注釋
1 # pylint: disable=no-member
問題就得以解決
如圖:
加入注釋前:
加入注釋后:
參考鏈接:http://pylint-messages.wikidot.com/messages:e1101