baxx
baxx

Reputation: 4695

Ignore typehinting for line that already has a pylint ignore

I'm wondering how to go about ignoring the mypy error for the following:

# check.py
def add(a, b):  # pylint: disable=invalid-name
    return a + b

running mypy . --strict will raise the following:

check.py:1: error: Function is missing a type annotation

So, how do i ignore typing for this line as well as pylint?

Upvotes: 2

Views: 872

Answers (1)

Laurent
Laurent

Reputation: 13458

As per PEP 484, disabling mypy first, then pylance, should work:

def add(a, b):  # type: ignore # pylint: disable=invalid-name
    return a + b

Upvotes: 1

Related Questions