The name __path__ is defined in packages but mypy doesn't recognize it. It seems that every __init__.py[i] file should have an implicit __path__ attribute with type List[str]. (I encountered some code that uses __path__ -- I didn't know about it until today.)
Activity
tonygrue-dbx commented on Apr 28, 2016
As a workaround for others (given to me by the experts) you can ignore this issue until it's fixed as such:
gvanrossum commented on Jun 4, 2016
Shouldn't be too hard to fix?
add support for __path__ attribute on modules
add support for __path__ attribute on modules
rth commented on Mar 22, 2020
If it helps a minimal reproducible example can be found below (I wrote one before discovering this issue),
A package with the following structure,
pkg1/ - setup.py - mypy_issue_example/ - __init__.pywith
setup.py
and
mypy_issue_example/__init__.py
Running,
Add __path__ to package __init__
Add __path__ to package __init__
Add __path__ to package __init__
Add __path__ to package __init__ (#9454)
lmar76 commented on Dec 11, 2021
I'm still having this error...
JelleZijlstra commented on Dec 11, 2021
This change hasn't been released yet.
jiridanek commented on Dec 21, 2021
Error disappeared for me as I upgraded mypy from 0.910 to 0.920
drgn.helpers.linux: remove unused "# type: ignore"
drgn.helpers.linux: remove unused "# type: ignore"