[flake8-comprehension] Mark autofix for C420 as unsafe if there's comments inside the dict comprehension (#18768)

This commit is contained in:
Victor Hugo Gomes 2025-06-19 06:43:05 -03:00 committed by GitHub
parent 06da2c808f
commit 65b288b45b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 66 additions and 2 deletions

View file

@ -90,3 +90,14 @@ def func():
def func():
{(a, b): a + b for (a, b) in [(1, 2), (3, 4)]} # OK
# https://github.com/astral-sh/ruff/issues/18764
{ # 1
a # 2
: # 3
None # 4
for # 5
a # 6
in # 7
iterable # 8
} # 9