からクラスを派生させた場合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)
最初は、StructureがCモジュールから来ているためだと思いました。SocketServer.BaseServer
クラスの1つ、または純粋なpythonからサブクラス化しても、警告は表示されません。smbus.SMBus
ただし、Cモジュールにあるからサブクラス化しても警告は表示されません。
W0231を無効にする以外の回避策を知っている人はいますか?