[ty] Cache constraint implication checks by charliermarsh · Pull Request #25714 · astral-sh/ruff (original) (raw)
Summary
When building sequent maps, we repeatedly compare the same ordered pairs of range constraints to determine whether one directly implies the other. Each comparison performs assignability checks for the lower and upper bounds, even when an earlier sequent calculation has already checked the same pair.
This change caches the final boolean result for each ordered constraint pair in the constraint-set builder, including negative results. Sequent construction and solving behavior remain unchanged, while later checks can reuse the existing result.