Open
Description
Bug description
Consider the following file a.py
from typing import List
def parse_dict(dict_object: List[dict], name: str) -> dict:
for dict in dict_object:
if dict.get("name") == name:
return dict
return {}
Command used
pylint a.py
Pylint output
************* Module a
a.py:4:33: W0631: Using possibly undefined loop variable 'dict' (undefined-loop-variable)
a.py:4:54: W0631: Using possibly undefined loop variable 'dict' (undefined-loop-variable)
Expected behavior
No warning.
Pylint version
pylint 2.12.2
astroid 2.9.0
Python 3.8.10 (default, Sep 28 2021, 16:10:42)
[GCC 9.3.0]