mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-20 20:45:41 +00:00
## 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
|
||
|---|---|---|
| .. | ||
| assignment_diagnostics.md | ||
| bytes.md | ||
| class.md | ||
| instance.md | ||
| lists.md | ||
| stepsize_zero.md | ||
| string.md | ||
| tuple.md | ||