Skip to content

gh-85222: Document the side effect in multiprocessing #136426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

aisk
Copy link
Contributor

@aisk aisk commented Jul 8, 2025

@@ -867,6 +867,10 @@ For an example of the usage of queues for interprocess communication see
locks/semaphores. When a process first puts an item on the queue a feeder
thread is started which transfers objects from a buffer into the pipe.

If the global start method has not been set, calling this function will
have the side effect of setting the current global start method.
See the :func:`get_context` function.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think repeating the same words here may be a bit 'noisy'. Could we just mention it once?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My concern is that if a user only uses one of these functions and checks that function's documentation, and unfortunately that is not the function that contains this document, they may mess it up.

But I'm unsure about this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I may be biased but I don't think the extra clarity hurts... I'm with @aisk

Copy link
Member

Choose a reason for hiding this comment

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

yeah, I asked for this to be mentioned everywhere for that reason as this is non-obvious behavior of multiprocessing. This could probably be refined a bit, i'll point some docs focused reviewers at it.

Copy link
Contributor

Choose a reason for hiding this comment

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

ԅ(≖‿≖ԅ) --

sorry i just had to :)

Copy link
Contributor

@LamentXU123 LamentXU123 Jul 10, 2025

Choose a reason for hiding this comment

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

My concern is that if a user only uses one of these functions and checks that function's documentation, and unfortunately that is not the function that contains this document, they may mess it up.

But I'm unsure about this.

IMO it may be better if we mentioned it once and create a reference link to the mention in every function. I'm not sure too (。・ω・。)

Copy link
Member

Choose a reason for hiding this comment

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

The repeated part could be a single sentence like Ensures that the current global start method is set., with ”global start method” linking to a longer explanation in a dedicated section.

@gpshead gpshead self-assigned this Jul 10, 2025

.. function:: Value(typecode_or_type, *args, lock=True)
Note that *lock* and *ctx* are keyword-only argument.
Copy link
Member

Choose a reason for hiding this comment

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

They are parameters, not arguments.

calling this function will have the side effect of setting the current global
start method if it has not been set already. See the :func:`get_context`
function.

Copy link
Member

Choose a reason for hiding this comment

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

Same here, parameters, not arguments.

@@ -977,6 +981,10 @@ For an example of the usage of queues for interprocess communication see

It is a simplified :class:`Queue` type, very close to a locked :class:`Pipe`.

If the global start method has not been set, calling this function will
Copy link
Member

Choose a reason for hiding this comment

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

After there's final wording for the repeated part is reworded, check that it's in all the contexts.

(This is class documentation; it should be “creating a SimpleQueue object” rather than “calling this function”.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review docs Documentation in the Doc dir skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

6 participants