[Python-checkins] gh-91340: Document multiprocessing.set_start_method force parameter (GH-32339)

miss-islington webhook-mailer at python.org
Sun Nov 27 13:06:05 EST 2022


https://github.com/python/cpython/commit/366adc7c832554454841fe7472c90f3ed9bf1f7d
commit: 366adc7c832554454841fe7472c90f3ed9bf1f7d
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-11-27T10:05:59-08:00
summary:

gh-91340: Document multiprocessing.set_start_method force parameter (GH-32339)


GH-91340

https://bugs.python.org/issue47184
(cherry picked from commit dfc2732a57e3ea6603d62f769d4f9c80be726fa4)

Co-authored-by: Sam Ezeh <sam.z.ezeh at gmail.com>
Automerge-Triggered-By: GH:kumaraditya303

files:
M Doc/library/multiprocessing.rst

diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index 551608478067..b5ceeb796f8f 100644
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -1089,10 +1089,14 @@ Miscellaneous
    .. versionchanged:: 3.11
       Accepts a :term:`path-like object`.
 
-.. function:: set_start_method(method)
+.. function:: set_start_method(method, force=False)
 
    Set the method which should be used to start child processes.
-   *method* can be ``'fork'``, ``'spawn'`` or ``'forkserver'``.
+   The *method* argument can be ``'fork'``, ``'spawn'`` or ``'forkserver'``.
+   Raises :exc:`RuntimeError` if the start method has already been set and *force*
+   is not ``True``.  If *method* is ``None`` and *force* is ``True`` then the start
+   method is set to ``None``.  If *method* is ``None`` and *force* is ``False``
+   then the context is set to the default context.
 
    Note that this should be called at most once, and it should be
    protected inside the ``if __name__ == '__main__'`` clause of the



More information about the Python-checkins mailing list