Inspectopedia 2026.2 Help

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:

class A: __slots__ = ('x',) class B: __slots__ = ('y',) class C(A, B): # error: A and B have incompatible disjoint bases pass

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.

Settings or Preferences | Editor | Inspections | Python

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:

//noinspection PyDisjointBase

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,

Last modified: 30 June 2026