Skip to content

C416 doesn't catch dictionary comprehensions with tuple targets #7307

@adamtheturtle

Description

@adamtheturtle

pylint 2.17.5 shows a R1721 error with the following file:

# example.py
"""Code which has R1721 error in pylint but not ruff."""

[(k, v) for k, v in {}.items()]

ruff 0.0.288 shows no error for this:

ruff --select=ALL --isolated example.py

I expect ruff to show an error in this case.
#970 has unnecessary-comprehension / R1721 checked as done.

Metadata

Metadata

Assignees

Labels

acceptedReady for implementationbugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions