ruff/crates/ruff_python_semantic
Charlie Marsh 768686148f
Add support for unions to our Python builtins type system (#6541)
## Summary

Fixes some TODOs introduced in
https://github.com/astral-sh/ruff/pull/6538. In short, given an
expression like `1 if x > 0 else "Hello, world!"`, we now return a union
type that says the expression can resolve to either an `int` or a `str`.
The system remains very limited, it only works for obvious primitive
types, and there's no attempt to do inference on any more complex
variables. (If any expression yields `Unknown` or `TypeError`, we
propagate that result throughout and abort on the client's end.)
2023-08-13 18:00:50 -04:00
..
src Add support for unions to our Python builtins type system (#6541) 2023-08-13 18:00:50 -04:00
Cargo.toml Add support for unions to our Python builtins type system (#6541) 2023-08-13 18:00:50 -04:00