ruff/crates/ty/docs
David Peter 4887bdf205
[ty] Infer types for key-based access on TypedDicts (#19763)
## Summary

This PR adds type inference for key-based access on `TypedDict`s and a
new diagnostic for invalid subscript accesses:

```py
class Person(TypedDict):
    name: str
    age: int | None

alice = Person(name="Alice", age=25)

reveal_type(alice["name"])  # revealed: str
reveal_type(alice["age"])  # revealed: int | None

alice["naem"]  # Unknown key "naem" - did you mean "name"?
```

## Test Plan

Updated Markdown tests
2025-08-06 09:36:33 +02:00
..
.gitattributes [ty] Mark generated files as such in .gitattributes (#18195) 2025-05-19 16:50:48 +02:00
cli.md [ty] Allow -qq for silent output mode (#19366) 2025-07-15 17:08:19 +00:00
configuration.md [ty] Add an empty line to separate bullet points (#19195) 2025-07-08 05:10:31 +00:00
environment.md Auto-generate environment variable references for ty (#19205) 2025-07-08 10:48:31 -04:00
mypy_primer.md [ty] Update mypy_primer doc (#18638) 2025-06-11 20:50:37 -07:00
rules.md [ty] Infer types for key-based access on TypedDicts (#19763) 2025-08-06 09:36:33 +02:00
tracing-flamegraph.png
tracing.md [ty] Minor typo in environment variable name (#17848) 2025-05-05 10:25:48 +00:00