mirror of
https://github.com/astral-sh/ruff.git
synced 2026-12-03 22:50:47 +08:00
508 B
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-basedetects class bases that may succeed at runtime, but which ty cannot understand.