gh-157216: Clarify that set_forkserver_preload() does not cover lazy imports - #157229
gh-157216: Clarify that set_forkserver_preload() does not cover lazy imports#157229VimalN2005 wants to merge 1 commit into
Conversation
… lazy imports Clarify behavior of module preloading in forkserver.
Documentation build overview
|
|
Thanks for picking this up. I filed the issue and took the measurements, so two substantive notes:
Also I've opened docs-gh-157216 covering these. Fine by me whichever a reviewer picks. |
set_forkserver_preload()does not cover lazily imported modules #157216Description
Clarifies in
Doc/library/multiprocessing.rstthatset_forkserver_preload()only preloads modules imported at the top level.Transitive dependencies that are imported lazily inside function or method bodies (for example,
_strptimeviadatetime.datetime.strptime()) are not loaded in the forkserver process and will instead be imported separately in each child process upon first use.