I have some code using a simple tcp socket setup to test something. We run pylint --errors-only in our python files, usually to test all our code.
However, a simple example code provided in the python socket library documentation - http://docs.python.org/library/socket.html - outputs:
************* Module SocketExample E: 16: Instance of '_socketobject' has no 'recv' member E: 18: Instance of '_socketobject' has no 'sendall' member
The documentation shows these members, the code works and works.
A disk from the socket also shows them:
>>> import socket >>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) >>> dir(s) ['__class__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__slots__', '__str__', '__subclasshook__', '__weakref__', '_sock', 'accept', 'bind', 'close', 'connect', 'connect_ex', 'dup', 'family', 'fileno', 'getpeername', 'getsockname', 'getsockopt', 'gettimeout', 'listen', 'makefile', 'proto', 'recv', 'recv_into', 'recvfrom', 'recvfrom_into', 'send', 'sendall', 'sendto', 'setblocking', 'setsockopt', 'settimeout', 'shutdown', 'type']
This refers to the snippet:
for method in _delegate_methods: setattr(self, method, getattr(_sock, method))
In the implementation of socket.py.
Is it possible to get this style to be accepted (and test it) or is it the only choice to ignore the "no member" warnings with # pylint: disable-msg=E1101 ?