-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugmypy got something wrongmypy got something wrong
Description
The following test fails, producing no output:
[case testInitNotInBuild1]
# cmd: mypy -m p.a p.b
# flags: --follow-imports=skip
[file p/__init__.py]
[file p/a.py]
import p.b
p.b.f('hi') # E: Argument 1 to "f" has incompatible type "str"; expected "int"
[file p/b.py]
def f(x: int) -> None: pass
Adding a reveal_type(p.b) reveals that its type is Any.
The following two variants of this test, using from ... import ..., both pass, however:
[case testInitNotInBuild2]
# cmd: mypy -m p.a p.b
# flags: --follow-imports=skip
[file p/__init__.py]
[file p/a.py]
from p.b import f
f('hi') # E: Argument 1 to "f" has incompatible type "str"; expected "int"
[file p/b.py]
def f(x: int) -> None: pass
[case testInitNotInBuild3]
# cmd: mypy -m p.a p.b
# flags: --follow-imports=skip
[file p/__init__.py]
[file p/a.py]
from p import b
b.f('hi') # E: Argument 1 to "f" has incompatible type "str"; expected "int"
[file p/b.py]
def f(x: int) -> None: pass
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrong