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
A # type: ignore comment at the top of a module (before any statements, including imports or docstrings) has the effect of ignoring the entire contents of the module.
However, it doesn't show what kind of errors mypy produces when importing from such a module.
As shown in the following example, mypy provides an error styled of error: Module "{{MODULE_NAME}}" has no attribute "{{ATTRIBUTE_NAME}}" [attr-defined].
Documentation
Ignoring a whole file explains the side effect of using
# type: ignore
at the top.However, it doesn't show what kind of errors mypy produces when importing from such a module.
As shown in the following example, mypy provides an error styled of
error: Module "{{MODULE_NAME}}" has no attribute "{{ATTRIBUTE_NAME}}" [attr-defined]
.Neither
has no attribute
nor[attr-defined]
appears in Ignoring a whole file nor in the whole page of Common issues and solutions.It took me an hour to find this cause, and I believe it's worth mentioning in the documentation.
foo.py:
bar.py:
Executing mypy on foo.py:
Environment:
The text was updated successfully, but these errors were encountered: