Closed
Description
Bug description
While there are plenty of tests for unnecessary_list_index_lookup, looks like missing is the case for using iterable
as a kwarg
# test.py
series = [1, 2, 3]
for idx, val in enumerate(iterable=series, start=0):
print(series[idx]) # should report [unnecessary-list-index-lookup] but currently isn't
Same code with iterable as an arg correctly reports and is tested.
Configuration
No response
Command used
pylint test.py
Pylint output
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 0.00/10, +10.00)
Expected behavior
test.py:4:10: R1736: Unnecessary list index lookup, use 'val' instead (unnecessary-list-index-lookup)
Pylint version
pylint 2.16.0-dev
astroid 2.12.12
Python 3.11.0
OS / Environment
No response
Additional dependencies
No response