ruff/crates/ty_python_semantic/resources/mdtest/assignment
Ibraheem Ahmed 96b156303b
[ty] Prefer declared type for invariant collection literals (#20927)
## Summary

Prefer the declared type for collection literals, e.g.,
```py
x: list[Any] = [1, "2", (3,)]
reveal_type(x)  # list[Any]
```

This solves a large part of https://github.com/astral-sh/ty/issues/136
for invariant generics, where respecting the declared type is a lot more
important. It also means that annotated dict literals with `dict[_,
Any]` is a way out of https://github.com/astral-sh/ty/issues/1248.
2025-10-16 16:11:28 -04:00
..
annotations.md [ty] Prefer declared type for invariant collection literals (#20927) 2025-10-16 16:11:28 -04:00
augmented.md [ty] Remove special casing for tuple addition (#19636) 2025-07-30 16:25:42 +00:00
multi_target.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
unbound.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
walrus.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00