Closed
Description
Bug description
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from foo import Bar
def myfunc():
result: Bar
from foo import Bar # if I remove this, then no error is reported
Note how if I remove the from foo import Bar
line, then the error goes away
Command used
pylint --disable=all --enable=used-before-assignment t.py
Pylint output
************* Module t
t.py:7:12: E0601: Using variable 'Bar' before assignment (used-before-assignment)
------------------------------------------------------------------
Your code has been rated at 1.67/10 (previous run: 1.67/10, +0.00)
Expected behavior
No error reported
Pylint version
pylint 2.15.7
astroid 2.12.13
Python 3.8.15 (default, Oct 12 2022, 19:15:16)
[GCC 11.2.0]