From a2ac8102cd46ef62740a09233820961a57a35dec Mon Sep 17 00:00:00 2001 From: Weijian He <230282609+Madin-H23@users.noreply.github.com> Date: Wed, 21 Oct 2026 17:52:06 +0800 Subject: [PATCH] Document how the daemon handles a changing set of source files (#15622) The daemon documentation only mentioned that a daemon process supports one set of source files, leaving open whether adding a file to the command line requires a restart (and loses the cached state). The running daemon picks up files added to the command line and type checks them without a restart, so the cached state is preserved. --- docs/source/mypy_daemon.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/source/mypy_daemon.rst b/docs/source/mypy_daemon.rst index 181915552aca6..4ee6ddb81d7aa 100644 --- a/docs/source/mypy_daemon.rst +++ b/docs/source/mypy_daemon.rst @@ -45,6 +45,14 @@ will always run on the current host. Example:: ``dmypy run`` will automatically restart the daemon if the configuration or mypy version changes. +.. note:: + + The set of source files may change between runs. If you add a file + to the command line, the running daemon picks it up and type checks + it without a restart, so the cached state is preserved. To type + check different sets of files at the same time, run one daemon per + set, each with its own status file (see ``--status-file``). + The initial run will process all the code and may take a while to finish, but subsequent runs will be quick, especially if you've only changed a few files. (You can use :ref:`remote caching `