If TYPE_CHECKING used
Detects usage of if TYPE_CHECKING: blocks from the typing module.
TYPE_CHECKING is False at runtime but True during static type checking. This creates a disconnect between type checking and runtime behavior that can cause errors.
The most dangerous pattern is using if TYPE_CHECKING with an else clause where signatures don't match:
What gets flagged
| Python | |
|---|---|
1 2 3 4 5 6 7 8 | |
Unsoundness Checker Output
| Text Only | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 | |
Mypy: No Diagnostic Emitted
Pyright: No Diagnostic Emitted
Ty: No Diagnostic Emitted