ruff/crates/ty_python_semantic/resources/mdtest/subscript
David Peter 04ab9170d6
[ty] Further improve subscript assignment diagnostics (#21411)
## Summary

Further improve subscript assignment diagnostics, especially for
`dict`s:

```py
config: dict[str, int] = {}

config["retries"] = "three"
```

<img width="1276" height="274" alt="image"
src="https://github.com/user-attachments/assets/9762c733-8d1c-4a57-8c8a-99825071dc7d"
/>

I have many more ideas, but this looks like a reasonable first step.
Thank you @AlexWaygood for some of the suggestions here.

## Test Plan

Update tests
2025-11-13 13:31:14 +01:00
..
assignment_diagnostics.md [ty] Faster subscript assignment checks for (unions of) TypedDicts (#21378) 2025-11-12 20:16:38 +01:00
bytes.md [ty] Integer indexing into bytes returns int (#18218) 2025-05-20 16:44:12 +02:00
class.md [ty] __class_getitem__ is a classmethod (#20192) 2025-09-01 11:22:19 +02:00
instance.md [ty] Further improve subscript assignment diagnostics (#21411) 2025-11-13 13:31:14 +01:00
lists.md [ty] Infer more precise types for collection literals (#20360) 2025-09-17 18:51:50 -04:00
stepsize_zero.md
string.md
tuple.md [ty] Fix bug where ty would think all types had an __mro__ attribute (#20995) 2025-10-27 11:19:12 +00:00