-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongdocumentationtopic-type-ignore# type: ignore comments# type: ignore comments
Description
Structure:
sample_proj/__init__.py:
from sample_proj.commons import some_const
from sample_proj.some_file import SomeClasssample_proj/comons.py:
some_const = 'qwe'sample_proj/some_file.py:
# type: ignore
from sample_proj.commons import some_const
class SomeClass:
def fun(self, param=some_const):
pass$ mypy sample_proj
sample_proj/__init__.py:2: error: Module "sample_proj.some_file" has no attribute "SomeClass"
Found 1 error in 1 file (checked 3 source files)
I think it's a bug.
Removing # type: ignore[union-attr] helps. I wanted this comment to ignore only this exact error in the whole file.
$ mypy --version
mypy 0.942
$ python3 --version
Python 3.10.5
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongdocumentationtopic-type-ignore# type: ignore comments# type: ignore comments