Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nasyxx opened this issue Jun 3, 2024 · 0 comments · Fixed by #11774
Closed
Labels
bug Something isn't working rule Implementing or modifying a lint rule

Comments

@nasyxx
Copy link

nasyxx commented Jun 3, 2024

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.

@AlexWaygood AlexWaygood added bug Something isn't working rule Implementing or modifying a lint rule labels Jun 3, 2024
charliermarsh added a commit to Embers-of-the-Fire/ruff that referenced this issue Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants