Skip to content

Commit c246a52

Browse files
authored
Improve searchability for module level type ignore errors (#14342)
1 parent 31b0413 commit c246a52

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/source/common_issues.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ Ignoring a whole file
188188

189189
A ``# type: ignore`` comment at the top of a module (before any statements,
190190
including imports or docstrings) has the effect of ignoring the entire contents of the module.
191+
This behaviour can be surprising and result in
192+
"Module ... has no attribute ... [attr-defined]" errors.
191193

192194
To only ignore errors, use a top-level ``# mypy: ignore-errors`` comment instead.
193195
To only ignore errors with a specific error code, use a top-level

0 commit comments

Comments
 (0)