Skip to content

Remove parentheses from tuples in comprehension target #5779

@MichaReiser

Description

@MichaReiser
# Input
{k: v for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension}

# black
{
    k: v
    for k, v in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension
}

# Ruff
{
    k: v
    for (
		k, 
		v
	) 
	in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension
}

Ruff should not add parentheses around k, v.

Metadata

Metadata

Assignees

Labels

formatterRelated to the formatter

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions