Skip to content

Improvement on reimplemented-starmap rule (FURB140) #7636

@alexprengere

Description

@alexprengere

I tested Ruff 0.0.291 which implements FURB140. It works great! I have a suggestion to cover more use cases in the same spirit:

def average(*args):
    return sum(args) / len(args)

# Correctly reported
print(sum(average(a, b) for a, b in [(85, 60), (100, 80)]))

# Currently not reported
print(sum(average(*t) for t in [(85, 60), (100, 80)]))

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedReady for implementationgood first issueGood for newcomersruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions