You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Doc/library/multiprocessing.rst
+8-28Lines changed: 8 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1049,45 +1049,25 @@ Miscellaneous
1049
1049
1050
1050
.. function:: get_context(method=None)
1051
1051
1052
-
Return a context object which has the same attributes as the
1053
-
:mod:`multiprocessing` module.
1052
+
Return a context object with the same attributes as the :mod:`multiprocessing` module.
1054
1053
1055
-
If *method* is ``None``, then the default context is returned.
1056
-
This method sets the default context globally, which may affect
1057
-
future usage of :func:`set_start_method`. If you wish to change the
1058
-
method later, it is recommended to explicitly specify a method other
1059
-
than ``None`` when calling this function. Otherwise, unexpected behavior
1060
-
may occur.
1054
+
If *method* is ``None``, the default context is returned. Be aware that calling this function with *method=None* sets the default context globally, potentially affecting future usage of :func:`set_start_method`. To change the method later, it is recommended to explicitly specify a method other than ``None`` when calling this function. Otherwise, it may lead to unexpected behavior.
1061
1055
1062
-
*method* should be one of the following:
1063
-
``'fork'``, ``'spawn'``, or ``'forkserver'``.
1064
-
:exc:`ValueError` is raised if the specified start
1065
-
method is not available. See :ref:`multiprocessing-start-methods`.
1056
+
*method* should be one of the following: ``'fork'``, ``'spawn'``, or ``'forkserver'``. A :exc:`ValueError` is raised if the specified start method is unavailable. See :ref:`multiprocessing-start-methods`.
1066
1057
1067
1058
.. versionadded:: 3.4
1068
1059
1069
1060
.. function:: get_start_method(allow_none=False)
1070
1061
1071
-
Return the name of the start method used for starting processes.
1062
+
Return the name of the start method used for initiating processes.
1072
1063
1073
-
If the start method has not been explicitly set
1074
-
(e.g., using :func:`set_start_method`) and *allow_none* is false,
1075
-
then the start method is fixed to the default and the name of the
1076
-
default method is returned. If the start method has not been explicitly
1077
-
set and *allow_none* is true, then ``None`` is returned, indicating that
1078
-
the method has not been explicitly set.
1064
+
If the start method has not been explicitly set (e.g., using :func:`set_start_method`) and *allow_none* is false, then the start method is fixed to the default, and the name of the default method is returned. If the start method has not been explicitly set and *allow_none* is true, then ``None`` is returned, indicating that the method has not been explicitly set.
1079
1065
1080
-
The return value can be one of the following:
1081
-
``'fork'``, ``'spawn'``, ``'forkserver'``, or ``None``.
1066
+
The return value can be one of the following: ``'fork'``, ``'spawn'``, ``'forkserver'``, or ``None``.
1082
1067
1083
-
.. note:: Changing the start method using ``multiprocessing.set_start_method``
1084
-
after using ``multiprocessing.get_start_method`` with *allow_none* set to ``False``
1085
-
may raise a ``RuntimeError``. Be cautious when changing the start method
1086
-
after it has been set.
1068
+
.. note:: Exercise caution when changing the start method using ``multiprocessing.set_start_method`` after using ``multiprocessing.get_start_method`` with *allow_none* set to ``False``, as it may raise a ``RuntimeError``.
1087
1069
1088
-
See
1089
-
:ref:`multiprocessing-start-methods` for more information on multiprocessing start
1090
-
methods and their implications.
1070
+
See :ref:`multiprocessing-start-methods` for more information on multiprocessing start methods and their implications.
0 commit comments