How to prevent python pylint complaining about socket class sendall method

后端 未结 2 1486
有刺的猬
有刺的猬 2021-02-20 18:08

I have a bit of code using a simple tcp socket setup to test something. We run pylint --errors-only on our python files, generally as a way to validate all our code

相关标签:
2条回答
  • 2021-02-20 18:47

    using the trick defined in http://www.logilab.org/blogentry/78354, we could start adding to pylint a generic astng plugin that would help him to understand such things from the stdlib (there is also various tickets/comments about hashlib in the tracker).

    That would be a great improvment indeed. Any volunteer ? :)

    Beside this, I don't think there is other options than disabling the message.

    0 讨论(0)
  • 2021-02-20 18:49

    You can use pylint --errors-only --ignored-classes=_socketobject or add

    [TYPECHECK]
    ignored-classes=SQLObject,_socketobject
    

    to your ~/.pylintrc file.

    From the documenation,

    ignored-classes:

    List of classes names for which member attributes should not be checked (useful for classes with attributes dynamically set).

    Default: SQLObject

    0 讨论(0)
提交回复
热议问题