ruff/crates/ty_python_semantic/src
Douglas Creager eda85f3c64
[ty] Constraining a typevar with itself (possibly via union or intersection) (#21273)
This PR carries over some of the `has_relation_to` logic for comparing a
typevar with itself. A typevar will specialize to the same type if it's
mentioned multiple times, so it is always assignable to and a subtype of
itself. (Note that typevars can only specialize to fully static types.)
This is also true when the typevar appears in a union on the right-hand
side, or in an intersection on the left-hand side. Similarly, a typevar
is always disjoint from its negation, so when a negated typevar appears
on the left-hand side, the constraint set is never satisfiable.

(Eventually this will allow us to remove the corresponding clauses from
`has_relation_to`, but that can't happen until more of #20093 lands.)
2025-11-05 12:31:53 -05:00
..
module_resolver [ty] add legacy namespace package support (#20897) 2025-10-17 03:16:37 +00:00
semantic_index [ty] Use "cannot" consistently over "can not" (#21255) 2025-11-03 10:38:20 -05:00
types [ty] Constraining a typevar with itself (possibly via union or intersection) (#21273) 2025-11-05 12:31:53 -05:00
ast_node_ref.rs [ty] Implement the legacy PEP-484 convention for indicating positional-only parameters (#20248) 2025-09-05 17:56:06 +01:00
db.rs [ty] Limit shown import paths to at most 5 unless ty runs with `-v` (#20912) 2025-10-16 13:18:09 +02:00
diagnostic.rs [ty] Remove mentions of VS Code from server logs (#21155) 2025-11-03 14:49:58 +00:00
dunder_all.rs [ty] follow the breaking API changes made in salsa-rs/salsa#1015 (#21117) 2025-10-29 14:56:12 +00:00
lib.rs [ty] Implement go-to for binary and unary operators (#21001) 2025-10-21 19:25:41 +02:00
lint.rs [ty] Add suggestion to unknown rule diagnostics, rename `unknown-rule` lint to `ignore-comment-unknown-rule` (#20948) 2025-10-18 12:44:21 +02:00
list.rs Update Rust toolchain to 1.89 (#19807) 2025-08-07 18:21:50 +02:00
module_name.rs [ty] Export some stuff from `ty_python_semantic` 2025-09-17 13:59:28 -04:00
node_key.rs [ty] Implement the legacy PEP-484 convention for indicating positional-only parameters (#20248) 2025-09-05 17:56:06 +01:00
place.rs [ty] Use "cannot" consistently over "can not" (#21255) 2025-11-03 10:38:20 -05:00
program.rs [ty] Remove mentions of VS Code from server logs (#21155) 2025-11-03 14:49:58 +00:00
pull_types.rs Update Rust toolchain to 1.88 and MSRV to 1.86 (#19011) 2025-06-28 20:24:00 +02:00
python_platform.rs Update Rust toolchain to 1.91 (#21179) 2025-11-01 01:50:58 +00:00
rank.rs [ty] Garbage-collect reachability constraints (#19414) 2025-07-21 14:16:27 -04:00
semantic_index.rs [ty] Support implicit imports of submodules in `__init__.pyi` (#20855) 2025-10-31 14:29:24 +00:00
semantic_model.rs [ty] Add comment explaining why `HasTrackedScope` is implemented for `Identifier` and why it works (#21057) 2025-10-24 09:48:57 +02:00
site_packages.rs [ty] Remove mentions of VS Code from server logs (#21155) 2025-11-03 14:49:58 +00:00
subscript.rs [ty] Use "cannot" consistently over "can not" (#21255) 2025-11-03 10:38:20 -05:00
suppression.rs [ty] Add suggestion to unknown rule diagnostics, rename `unknown-rule` lint to `ignore-comment-unknown-rule` (#20948) 2025-10-18 12:44:21 +02:00
types.rs [ty] Constraining a typevar with itself (possibly via union or intersection) (#21273) 2025-11-05 12:31:53 -05:00
unpack.rs [ty] Track heap usage of salsa structs (#19790) 2025-08-12 13:28:44 +02:00