ctypes.BigEndianStructure
,pylint警告如果我不打电话
BigEndianStructure.__init__()
. 很好,但如果我修复了代码,pylint仍然警告:
import ctypes
class Foo(ctypes.BigEndianStructure):
def __init__(self):
ctypes.BigEndianStructure.__init__(self)
$ pylint mymodule.py
C: 1: Missing docstring
C: 3:Foo: Missing docstring
W: 4:Foo.__init__: __init__ method from base class 'Structure' is not called
W: 4:Foo.__init__: __init__ method from base class 'BigEndianStructure' is not called
R: 3:Foo: Too few public methods (0/2)
起初我认为这是因为结构来自C模块。如果我从我的一个类中创建子类,或者说,
SocketServer.BaseServer
这是纯python。但是如果我从
smbus.SMBus
,它位于C模块中。