-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Closed
Copy link
Description
I noticed a change in behavior between versions 0.720 and 0.730 when using pkgutil-style namespace packages.
For the following __init__.py file:
__path__ = __import__('pkgutil').extend_path(__path__, __name__)mypy == 0.720 will report:
$ mypy --version
mypy 0.720
$ mypy --show-traceback __init__.py
__init__.py:2: error: Cannot determine type of '__path__'
Thus, I "resolved" this with the following in, in 0.720:
from typing import Iterable
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: Iterable[str]With mypy ==0.730, I get the following:
$ mypy --version
mypy 0.730
mypy --show-traceback __init__.py
__init__.py:2: error: Module has no attribute "extend_path"
Found 1 error in 1 file (checked 1 source file)
When researching this issue, #7501 (comment) indicates that __import__ is not followed. However, I don't fully understand the change in behavior and had trouble using git-bisect to narrow it down.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels