You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from . importbarclassFoo:
defbar(arg: bar.Spam):
pass
top/bar.py:
classSpam:
pass
mypy -m top fails:
top/__init__.py:4: error: Invalid type "top.Foo.bar"
This is because it prematurely assumes that bar is a function, not a module.
Interestingly, regular functions do not exhibit this behaviour. The following works fine:
from . importbardefbar(arg: bar.Spam):
pass
The text was updated successfully, but these errors were encountered:
Given the following module structure:
And the following module contents:
top/__init__.py
:top/bar.py
:mypy -m top
fails:top/__init__.py:4: error: Invalid type "top.Foo.bar"
This is because it prematurely assumes that
bar
is a function, not a module.Interestingly, regular functions do not exhibit this behaviour. The following works fine:
The text was updated successfully, but these errors were encountered: