Skip to content

FURB118, lambda x: x[I, ii] should be itemgetter((I, ii)), instead of itemgetter(I, ii) #11714

@nasyxx

Description

@nasyxx

In refurb, lambda x: x[I, ii] should be itemgetter((I, ii)), instead of itemgetter(I, ii)

# xx.py
xs = [1, 2, 3]
xm = map(lambda x: x[i, ii], xs)
xx.py:3:10: FURB118 [*] Use `operator.itemgetter(i, ii)` instead of defining a lambda

It's a tuple.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingruleImplementing 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