We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
operator.itemgetter cannot be used to replace a lambda function for indexing with lambda arguments.
operator.itemgetter
# xxx.py xs = [1, 2, 3, 4, 5] xm = map(lambda x: x[5-x], xs)
xxx.py: 3:10 FURB118 [*] Use `operator.itemgetter(5-x)` instead of defining a lambda
Here if replaced with operator.itemgetter(5-x), the x would be a undefined variable
operator.itemgetter(5-x)
ruff: 0.4.5 python: 3.12.2
The text was updated successfully, but these errors were encountered:
Makes sense, thanks.
Sorry, something went wrong.
Avoid recomending operator.itemgetter with dependence on lambda arg (#…
ab107ef
…11574) ## Summary Closes #11573.
Fixed in the next release.
charliermarsh
Successfully merging a pull request may close this issue.
operator.itemgetter
cannot be used to replace a lambda function for indexing with lambda arguments.Here if replaced with
operator.itemgetter(5-x)
, the x would be a undefined variableThe text was updated successfully, but these errors were encountered: