ruff icon indicating copy to clipboard operation
ruff copied to clipboard

detect unnecessary keys() call in e.g. `for k in sorted(my_dict.keys()):`

Open ctcjab opened this issue 1 month ago • 1 comments

Summary

Similar to https://docs.astral.sh/ruff/rules/in-dict-keys/ (which currently is not triggered when there is a surrounding call to sorted, reversed, etc.)

ctcjab avatar Dec 15 '25 22:12 ctcjab

This might make sense as an extension to SIM118 rather than a separate rule too.

ntBre avatar Dec 16 '25 13:12 ntBre