Inheritance from classes with disjoint bases
Reports a class that inherits from two base classes with incompatible disjoint bases (PEP 800).
A class is a disjoint base when it carries the @typing.disjoint_base decorator or has a non-empty __slots__ attribute (including dataclasses created with slots=True). Many built-in types — int, str, float, tuple, list, dict, and others — are disjoint bases.
If two classes each trace back to a different, unrelated disjoint base, they cannot share a common subclass — Python raises a TypeError at runtime due to incompatible memory layouts.
Example:
Classes that share a common disjoint base ancestor (e.g., two subclasses of the same slotted class) are not flagged.
Locating this inspection
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
PyDisjointBase- Via Settings dialog
Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.
Inspection ID: PyDisjointBaseInspection
Suppressing Inspection
You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:
More detailed instructions as well as other ways and options that you have can be found in the product documentation:
Inspection Details | |
|---|---|
By default bundled with: | CLion 2026.2, IntelliJ IDEA 2026.2, PyCharm 2026.2, Qodana for JVM 2026.2, |