[cell-var-from-loop] false positive for lambda used as keyword arg #5508
Labels
direct parentage assumption
False Positive 🦟
A message is emitted but nothing is wrong with the code
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Bug description
Hi,
I'm little confused by this warning which
pylint 2.12.2
found in the followingexample.py
:I got rid of this warning by replacing
key=lambda msg: msg[sorting_keys[category]]
withkey=operator.itemgetter(sorting_keys[category])
.TBH I'm not sure why pylint complains about
category
being defined in loop.Especially, because both versions of the code, give exactly the same result:
This might be a continuation of: #4827
Thanks
Configuration
No response
Command used
Pylint output
Expected behavior
No warnings
Pylint version
OS / Environment
Fedora 35
Additional dependencies
astroid==2.9.0
isort==5.10.1
lazy-object-proxy==1.6.0
mccabe==0.6.1
platformdirs==2.4.0
pylint==2.12.2
toml==0.10.2
wrapt==1.13.3
The text was updated successfully, but these errors were encountered: