How to exclude __init__.py files when used with mypy daemon
04:34 24 Jun 2026

I didn't succeed to have mypy daemon (used with Mypy VS Code extension) not analyse __init__.py files.

It works without using the daemon.

[tool.mypy]
python_version = "3.14"
strict = true
cache_dir = ".cache/mypy"
implicit_reexport = true
# follow_imports = "silent"
exclude = [
  '(^|/)__init__\.py$',  # does not work
]


[[tool.mypy.overrides]]
module = ['myapp.tests.*', 'myapp.settings.*']
ignore_errors = true

I suppose I can't use tool.mypy.overrides to exclude a __init__.py file, but maybe I miss something.

Any solution other than adding # mypy: ignore-errors at top of files?

python mypy