Files

508 B

What it does

Checks for class definitions that have bases which will lead to exceptions at runtime.

Why is this bad?

At runtime, a class base must either be an instance of type or have a valid __mro_entries__ method. A class base that fails both criteria will lead to TypeError being raised at runtime.

Examples

class A(42): ...  # error: [invalid-base]

See also

  • unsupported-base detects class bases that may succeed at runtime, but which ty cannot understand.