-
-
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-0-highsemantic-analyzerProblems that happen during semantic analysisProblems that happen during semantic analysistopic-import-cycles
Description
These two test cases should be equivalent (with new semantic analyzer), but the second generates an error. The only difference is the order in which modules are processed within an import cycle.
[case testNewAnalyzerImportStarForwardRef1]
import a
[file a.py]
x: A
from b import * # No error
class A: pass
[file b.py]
MYPY = False
if MYPY:
from a import x
[case testNewAnalyzerImportStarForwardRef2]
import a
[file a.py]
x: A
MYPY = False
if MYPY:
from b import * # Unexpected error: Name 'x' already defined on line 1
class A: pass
[file b.py]
from a import x
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-0-highsemantic-analyzerProblems that happen during semantic analysisProblems that happen during semantic analysistopic-import-cycles