inconsistent-mro / E0240ΒΆ

Message emitted:

Inconsistent method resolution order for class %r

Description:

Used when a class has an inconsistent method resolution order.

Problematic code:

class A:
    pass


class B(A):
    pass


class C(A, B):  # [inconsistent-mro]
    pass

Correct code:

class A:
    pass


class B(A):
    pass


class C(B):  # or 'B, A' or 'A' but not 'A, B'
    pass

Created by the classes checker.