ruff
34052a11 - [`flake8-comprehensions`] Fix `C420` to prepend whitespace when needed (#18616)

Commit
189 days ago
[`flake8-comprehensions`] Fix `C420` to prepend whitespace when needed (#18616) <!-- Thank you for contributing to Ruff/ty! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? (Please prefix with `[ty]` for ty pull requests.) - Does this pull request include references to any relevant issues? --> ## Summary This PR fixes rule C420's fix. The fix replaces `{...}` with `dict....(...)`. Therefore, if there is any identifier or such right before the fix, the fix will fuse that previous token with `dict...`. The example in the issue is ```python 0 or{x: None for x in "x"} # gets "fixed" to 0 ordict.fromkeys(iterable) ``` ## Related Issues Fixes: https://github.com/astral-sh/ruff/issues/18599
Author
Parents
Loading