8000 gh-109070: Document that get_context in multiprocessing have side eff… · python/cpython@77a8bd2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 77a8bd2

Browse files
authored
gh-109070: Document that get_context in multiprocessing have side effect (#136341)
Document that get_context in multiprocessing have side effect
1 parent d22e073 commit 77a8bd2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Doc/library/multiprocessing.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,9 @@ Miscellaneous
11181118
Return a context object which has the same attributes as the
11191119
:mod:`multiprocessing` module.
11201120

1121-
If *method* is ``None`` then the default context is returned.
1121+
If *method* is ``None`` then the default context is returned. Note that if
1122+
the global start method has not been set, this will set it to the
1123+
default method.
11221124
Otherwise *method* should be ``'fork'``, ``'spawn'``,
11231125
``'forkserver'``. :exc:`ValueError` is raised if the specified
11241126
start method is not available. See :ref:`multiprocessing-start-methods`.
@@ -1129,10 +1131,10 @@ Miscellaneous
11291131

11301132
Return the name of start method used for starting processes.
11311133

1132-
If the start method has not been fixed and *allow_none* is false,
1133-
then the start method is fixed to the default and the name is
1134-
returned. If the start method has not been fixed and *allow_none*
1135-
is true then ``None`` is returned.
1134+
If the global start method has not been set and *allow_none* is
1135+
``False``, then the start method is set to the default and the name
1136+
is returned. If the start method has not been set and *allow_none* is
1137+
``True`` then ``None`` is returned.
11361138

11371139
The return value can be ``'fork'``, ``'spawn'``, ``'forkserver'``
11381140
or ``None``. See :ref:`multiprocessing-start-methods`.

0 commit comments

Comments
 (0)
0