PyCQA / flake8-bugbear

A plugin for Flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle.
MIT License
1.06k stars 104 forks source link

Warn about static key in a dict comprehension #391

Closed Skylion007 closed 10 months ago

Skylion007 commented 1 year ago

The full case for using this is made in this ruff issue. I can't think of any case where using a static key in a dict comprehension is intended unless there is some recursive reduction with the old value. https://github.com/astral-sh/ruff/issues/4857

cooperlees commented 10 months ago

Added with attached PR