ruff
5c3c0c47 - [red-knot] Inference for comparison of union types (#13781)

Commit
353 days ago
[red-knot] Inference for comparison of union types (#13781) ## Summary Add type inference for comparisons involving union types. For example: ```py one_or_two = 1 if flag else 2 reveal_type(one_or_two <= 2) # revealed: Literal[True] reveal_type(one_or_two <= 1) # revealed: bool reveal_type(one_or_two <= 0) # revealed: Literal[False] ``` closes #13779 ## Test Plan See `resources/mdtest/comparison/unions.md`
Author
Parents
Loading