mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-09 18:02:19 +00:00
![]() <!-- Thank you for contributing to Ruff! 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? - Does this pull request include references to any relevant issues? --> ## Summary <!-- What's the purpose of the change? What does it do, and why? --> Fix #11482. Applies https://github.com/adamchainz/flake8-comprehensions/pull/205 to ruff. `C416` should be skipped if comprehension contains unpacking. Here's an example: ```python list_of_lists = [[1, 2], [3, 4]] # ruff suggests `list(list_of_lists)` here, but that would change the result. # `list(list_of_lists)` is not `[(1, 2), (3, 4)]` a = [(x, y) for x, y in list_of_lists] # This is equivalent to `list(list_of_lists)` b = [x for x in list_of_lists] ``` ## Test Plan <!-- How was it tested? --> Existing checks --------- Signed-off-by: harupy <hkawamura0130@gmail.com> |
||
---|---|---|
.. | ||
C400.py | ||
C401.py | ||
C402.py | ||
C403.py | ||
C404.py | ||
C405.py | ||
C406.py | ||
C408.py | ||
C409.py | ||
C410.py | ||
C411.py | ||
C413.py | ||
C414.py | ||
C415.py | ||
C416.py | ||
C417.py | ||
C418.py | ||
C419.py | ||
C419_1.py | ||
C419_2.py | ||
C420.py |