Back to Ruff

TypeError: Cannot create a consistent method resolution order

crates/ty_python_semantic/resources/lint_docs/inconsistent-mro.md

0.15.18431 B
Original Source

What it does

Checks for classes with an inconsistent method resolution order (MRO).

Why is this bad?

Classes with an inconsistent MRO will raise a TypeError at runtime.

Examples

python
class A: ...


class B(A): ...


# TypeError: Cannot create a consistent method resolution order
class C(A, B): ...  # error