Closed
Description
Consider this test case which currently fails with Cannot determine type of "tp"
:
[case testNamedTupleImportCycle]
import b
[file a.py]
class C:
pass
from b import tp
reveal_type(tp) # Cannot determine type of 'tp'
tp('x') # Cannot determine type of 'tp'
[file b.py]
from a import C
from typing import NamedTuple
tp = NamedTuple('tp', [('x', int)])
[out]
Note however that such code will anyway fail at runtime, and it works if one imports under if MYPY:
(see #2015). I think therefore it is relatively low priority.
This is a follow up for #5635