ruff
8fcac0ff - Recognize all symbols named `TYPE_CHECKING` for `in_type_checking_block` (#15719)

Commit
241 days ago
Recognize all symbols named `TYPE_CHECKING` for `in_type_checking_block` (#15719) Closes #15681 ## Summary This changes `analyze::typing::is_type_checking_block` to recognize all symbols named "TYPE_CHECKING". This matches the current behavior of mypy and pyright as well as `flake8-type-checking`. It also drops support for detecting `if False:` and `if 0:` as type checking blocks. This used to be an option for providing backwards compatibility with Python versions that did not have a `typing` module, but has since been removed from the typing spec and is no longer supported by any of the mainstream type checkers. ## Test Plan `cargo nextest run` --------- Co-authored-by: Micha Reiser <micha@reiser.io>
Author
Parents
Loading