mirror of
https://github.com/astral-sh/ruff
synced 2026-01-20 21:10:48 -05:00
## Summary Fixes #14550. Add `AlwaysTruthy` and `AlwaysFalsy` types, representing the set of objects whose `__bool__` method can only ever return `True` or `False`, respectively, and narrow `if x` and `if not x` accordingly. ## Test Plan - New Markdown test for truthiness narrowing `narrow/truthiness.md` - unit tests in `types.rs` and `builders.rs` (`cargo test --package red_knot_python_semantic --lib -- types`)