ruff
1e4b421a - [`ruff`] Implement `mutable-fromkeys-value` (`RUF024`) (#9597)

Commit
2 years ago
[`ruff`] Implement `mutable-fromkeys-value` (`RUF024`) (#9597) ## Summary Implement rule `mutable-fromkeys-value` (`RUF023`). Autofixes ```python dict.fromkeys(foo, []) ``` to ```python {key: [] for key in foo} ``` The fix is marked as unsafe as it changes runtime behaviour. It also uses `key` as the comprehension variable, which may not always be desired. Closes #4613. ## Test Plan `cargo test`
Author
Parents
Loading