Avoid Pylint warning E1101: 'Instance of .. has no .. member' for class with dynamic attributes

后端 未结 6 1649
走了就别回头了
走了就别回头了 2020-11-27 04:02

Imagine a function which dynamically adds attributes to an object using setattr. The reason for doing so is that I want to map some external structure

6条回答
  •  独厮守ぢ
    2020-11-27 04:55

    Just to provide the answer that works for me now - as The Compiler suggested you can add a rule for the problematic class in your projects .pylintrc:

    [TYPECHECK]
    ignored-classes=Fysom,MyClass
    

提交回复
热议问题