-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Incorrect handling of proxy imports #7067
Copy link
Copy link
Closed
Labels
bugmypy got something wrongmypy got something wrong
Description
Regression in 0.710 (still not fixed in 0.711). Not sure how it's called properly, but the problem is that mypy doesn't properly handle symbols imported from a package which imports them too. Example:
provider.py
def foobar1() -> None:
pass
def foobar2() -> None:
pass
def foobar3() -> None:
passproxy.py
from provider import foobar1, foobar2, foobar3main.py
from proxy import foobar1, foobar2, foobar3main.py runs without errors and mypy 0.701 doesn't complain. However mypy 0.710 does:
main.py:1: error: Module 'proxy' has no attribute 'foobar1'; maybe "foobar3" or "foobar2"?
main.py:1: error: Module 'proxy' has no attribute 'foobar2'; maybe "foobar3" or "foobar1"?
main.py:1: error: Module 'proxy' has no attribute 'foobar3'; maybe "foobar2" or "foobar1"?
It's funny it complains on the very names it suggests. Adding __all__ to proxy.py doesn't help (however IMO it should work regardless).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrong