Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions Doc/library/multiprocessing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1049,27 +1049,25 @@ Miscellaneous

.. function:: get_context(method=None)

Return a context object which has the same attributes as the
:mod:`multiprocessing` module.
Return a context object with the same attributes as the :mod:`multiprocessing` module.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We tend to avoid unrelated changes, pleas revert the change to the summary line.


If *method* is ``None`` then the default context is returned.
Otherwise *method* should be ``'fork'``, ``'spawn'``,
``'forkserver'``. :exc:`ValueError` is raised if the specified
start method is not available. See :ref:`multiprocessing-start-methods`.
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now one incredibly long line. Please revert the change, and limit new lines to 79 characters long.


*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`.

.. versionadded:: 3.4

.. function:: get_start_method(allow_none=False)

Return the name of start method used for starting processes.
Return the name of the start method used for initiating processes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, please revert the change to this line


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.

The return value can be one of the following: ``'fork'``, ``'spawn'``, ``'forkserver'``, or ``None``.

If the start method has not been fixed and *allow_none* is false,
then the start method is fixed to the default and the name is
returned. If the start method has not been fixed and *allow_none*
is true then ``None`` is returned.
.. 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``.

The return value can be ``'fork'``, ``'spawn'``, ``'forkserver'``
or ``None``. See :ref:`multiprocessing-start-methods`.
See :ref:`multiprocessing-start-methods` for more information on multiprocessing start methods and their implications.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add your changes on new lines and limit unrelated changes.


.. versionchanged:: 3.8

Expand Down