-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-1-normaltopic-import-cyclestopic-named-tupletopic-typed-dict
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
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-1-normaltopic-import-cyclestopic-named-tupletopic-typed-dict