mirror of
https://github.com/astral-sh/ruff
synced 2026-01-11 00:24:13 -05:00
## Summary This PR closes #15722. The change is that if the variable `TYPE_CHECKING` is defined/imported, the type of the variable is interpreted as `Literal[True]` regardless of what the value is. This is compatible with the behavior of other type checkers (e.g. mypy, pyright). ## Test Plan I ran the tests with `cargo test -p red_knot_python_semantic` and confirmed that all tests passed. --------- Co-authored-by: Carl Meyer <carl@astral.sh>