mypy
mypy copied to clipboard
(🐞) `Protocol`s that narrow to modules become `Any`
from typing import Protocol
import test2 # def foo() -> None: ...
class P(Protocol):
def foo(self) -> None: ...
a: P = test2
reveal_type(a.foo()) # None
a = test2
reveal_type(a.foo()) # Any