Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/source/common_issues.rst
Original file line number Diff line number Diff line change
Expand Up @@ -472,3 +472,25 @@ Here's the above example modified to use ``MYPY``:

def listify(arg: 'bar.BarClass') -> 'List[bar.BarClass]':
return [arg]


Silencing Linters
-----------------

In some cases, linters will complain about unused imports or code. In
these cases, you can silence them with a comment after type comments, or on
the same line as the import:

.. code-block:: python

# to silence complaints about unused imports
from typing import List # noqa
a = None # type: List[int]


To silence the linter on the same line as a type comment
put the linter comment *after* the type comment:

.. code-block:: python

a = some_complex_thing() # type: ignore # noqa