ruff/crates/ty_python_semantic/resources/mdtest/literal
David Peter 73107a083c
[ty] Type inference for comprehensions (#20962)
## Summary

Adds type inference for list/dict/set comprehensions, including
bidirectional inference:

```py
reveal_type({k: v for k, v in [("a", 1), ("b", 2)]})  # dict[Unknown | str, Unknown | int]

squares: list[int | None] = [x for x in range(10)]
reveal_type(squares)  # list[int | None]
```

## Ecosystem impact

I did spot check the changes and most of them seem like known
limitations or true positives. Without proper bidirectional inference,
we saw a lot of false positives.

## Test Plan

New Markdown tests
2025-11-02 14:35:33 +01:00
..
collections [ty] Type inference for comprehensions (#20962) 2025-11-02 14:35:33 +01:00
boolean.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
bytes.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
complex.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
ellipsis.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
f_string.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
float.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
integer.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
string.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00