-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
Description
This incremental mode test case (added to check-incremental.test) started generating a false positive after e1643ae:
[case testIncrementalAccessSubmoduleWithoutExplicitImport]
import b
import a
[file a.py]
import pkg
pkg.submod.foo()
[file a.py.2]
import pkg
pkg.submod.foo()
x = 1
[file b.py]
import c
[file c.py]
from pkg import submod
[file pkg/__init__.pyi]
[file pkg/submod.pyi]
def foo() -> None: passIt fails like this:
---------------------------------------------------- Captured stderr call ----------------------------------------------------
Expected:
Actual:
tmp/a.py:3: error: "object" has no attribute "submod" (diff)
On the previous commit (9c26271) the test passes.
This also generated false positives in an internal codebase at work when we tried using a recent mypy development version.
The original behavior is questionable, but different semantics in incremental and non-incremental modes is a much bigger issue.
Credits to @p-sawicki for finding the commit that introduced this.
cc @ilevkivskyi