If a class uses multiple inheritance, pylint 0.21 does not pick up any but the first base class, if the bases classes are in a different module.
For example:
## test.py
import testmodule
class C(testmodule.A, testmodule.B):
def __init__(self):
testmodule.A.__init__(self)
testmodule.B.__init__(self)
self.cvar = "C"
if __name__ == "__main__":
c = C()
print c.avar, c.bvar, c.cvar
## testmodule.py
class A:
def __init__(self):
self.avar = "A"
class B:
def __init__(self):
self.bvar = "B"
gewoia : pylint test.py
************* Module test
W0233: 7:C.__init__: __init__ method from a non direct base class 'B' is called
E1101: 12: Instance of 'C' has no 'bvar' member
I have various other errors and warnings as a result of this situation also.
The problem disappears if you move classes "A" and "B" into the same file. It is not present in version 0.19, don't know about 0.20. |