File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -472,3 +472,25 @@ Here's the above example modified to use ``MYPY``:
472
472
473
473
def listify (arg : ' bar.BarClass' ) -> ' List[bar.BarClass]' :
474
474
return [arg]
475
+
476
+
477
+ Silencing Linters
478
+ -----------------
479
+
480
+ In some cases, linters will complain about unused imports or code. In
481
+ these cases, you can silence them with a comment after type comments, or on
482
+ the same line as the import:
483
+
484
+ .. code-block :: python
485
+
486
+ # to silence complaints about unused imports
487
+ from typing import List # noqa
488
+ a = None # type: List [ int ]
489
+
490
+
491
+ To silence the linter on the same line as a type comment
492
+ put the linter comment *after * the type comment:
493
+
494
+ .. code-block :: python
495
+
496
+ a = some_complex_thing() # type: ignore # noqa
You can’t perform that action at this time.
0 commit comments