ruff
ruff copied to clipboard
detect unnecessary keys() call in e.g. `for k in sorted(my_dict.keys()):`
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.)
This might make sense as an extension to SIM118 rather than a separate rule too.