58 words
1 minute
Ignoring a line in both flake8 and mypy
Anubhav Gain
2024-06-23

Ignoring a line in both flake8 and mypy#

I needed to tell both flake8 and mypy to ignore the same line of code.

This worked:

from sqlite3.dump import _iterdump as iterdump # type: ignore # noqa: F401

The order here mattered. This did not get picked up by both tools:

# noqa: F401 # type: ignore

But this did:

# type: ignore # noqa: F401
Ignoring a line in both flake8 and mypy
https://mranv.pages.dev/posts/ignoring-a-line-in-both-flake8-and-mypy/
Author
Anubhav Gain
Published at
2024-06-23
License
CC BY-NC-SA 4.0