ruff/crates/ty_python_semantic/resources/mdtest/literal/collections
Ibraheem Ahmed e84d523bcf
[ty] Infer more precise types for collection literals (#20360)
## Summary

Part of https://github.com/astral-sh/ty/issues/168. Infer more precise types for collection literals (currently, only `list` and `set`). For example,

```py
x = [1, 2, 3] # revealed: list[Unknown | int]
y: list[int] = [1, 2, 3] # revealed: list[int]
```

This could easily be extended to `dict` literals, but I am intentionally limiting scope for now.
2025-09-17 18:51:50 -04:00
..
dictionary.md [ty] Infer slightly more precise types for comprehensions (#20111) 2025-08-27 13:21:47 +01:00
generator_expressions.md [ty] Infer slightly more precise types for comprehensions (#20111) 2025-08-27 13:21:47 +01:00
list.md [ty] Infer more precise types for collection literals (#20360) 2025-09-17 18:51:50 -04:00
set.md [ty] Infer more precise types for collection literals (#20360) 2025-09-17 18:51:50 -04:00
tuple.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00