mirror of
https://github.com/astral-sh/ruff
synced 2026-01-22 05:51:03 -05:00
## Summary
We need to avoid raising "rewrite as a comprehension" violations in
cases like:
```python
d = defaultdict(list)
for i in [1, 2, 3]:
d[i].append(i**2)
```
Closes https://github.com/astral-sh/ruff/issues/5494.
Closes https://github.com/astral-sh/ruff/issues/5500.