Shunsuke Shibayama
1977dda079
[red-knot] respect TYPE_CHECKING even if not imported from typing ( #16468 )
...
## 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 >
2025-03-04 07:58:29 -08:00
..
2025-02-28 10:04:30 +00:00
2025-02-18 13:34:39 +01:00
2025-02-25 20:38:15 +01:00
2024-12-21 11:33:10 +01:00
2025-02-04 08:27:17 +01:00
2025-02-26 07:06:04 -08:00
2025-02-25 20:38:15 +01:00
2025-02-19 10:22:30 -05:00
2025-02-21 19:26:05 +01:00
2024-12-17 09:49:39 +05:30
2025-02-25 09:58:08 +01:00
2025-02-03 09:27:29 +00:00
2025-02-12 08:52:11 +01:00
2025-02-20 12:25:55 +00:00
2025-02-24 15:17:16 +01:00
2024-12-06 12:55:56 -08:00
2025-02-14 15:17:51 +05:30
2025-01-16 11:21:56 -08:00
2025-02-25 20:38:15 +01:00
2025-02-21 21:05:48 +00:00
2025-02-04 08:27:17 +01:00
2025-02-24 15:17:16 +01:00
2025-02-05 22:26:15 +01:00
2025-02-25 20:38:15 +01:00
2025-02-28 16:45:21 +00:00
2025-02-24 09:55:34 +01:00
2025-02-05 22:26:15 +01:00
2025-02-20 23:22:26 +01:00
2025-02-21 20:46:36 +00:00
2025-02-25 20:00:38 +01:00
2025-02-21 19:26:05 +01:00
2025-02-18 13:34:39 +01:00
2024-10-31 21:00:51 +00:00
2025-02-25 20:00:38 +01:00
2025-02-25 09:58:08 +01:00
2024-12-19 21:02:14 +00:00
2025-02-04 08:27:17 +01:00
2025-02-03 09:27:29 +00:00
2024-12-06 02:41:33 +00:00
2025-03-04 07:58:29 -08:00
2025-02-03 09:27:29 +00:00
2025-02-04 08:27:17 +01:00
2025-02-04 08:27:17 +01:00
2025-02-04 08:27:17 +01:00
2025-01-20 09:55:54 +01:00
2025-02-20 23:22:26 +01:00
2025-02-24 09:55:34 +01:00
2025-02-06 07:15:26 +00:00
2025-02-20 23:22:26 +01:00
2025-02-05 22:26:15 +01:00
2025-02-05 17:47:49 -05:00
2025-02-21 19:26:05 +01:00
2025-02-14 12:24:10 -08:00
2025-02-03 09:27:29 +00:00