8000 Doc: Clarify the return type of Event.wait when timeout is used. by pelson · Pull Request #104168 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Doc: Clarify the return type of Event.wait when timeout is used. #104168

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

Merged
merged 5 commits into from
Feb 26, 2024
Merged
Changes from all 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
17 changes: 7 additions & 10 deletions Doc/library/threading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -987,18 +987,15 @@ method. The :meth:`~Event.wait` method blocks until the flag is true.

.. method:: wait(timeout=None)

Block until the internal flag is true. If the internal flag is true on
entry, return immediately. Otherwise, block until another thread calls
:meth:`.set` to set the flag to true, or until the optional timeout occurs.
Block as long as the internal flag is false and the timeout, if given,
has not expired. The return value represents the
reason that this blocking method returned; ``True`` if returning because
the internal flag is set to true, or ``False`` if a timeout is given and
the the internal flag did not become true within the given wait time.

When the timeout argument is present and not ``None``, it should be a
floating point number specifying a timeout for the operation in seconds
(or fractions thereof).

This method returns ``True`` if and only if the internal flag has been set to
true, either before the wait call or after the wait starts, so it will
always return ``True`` except if a timeout is given and the operation
times out.
floating point number specifying a timeout for the operation in seconds,
or fractions thereof.

.. versionchanged:: 3.1
Previously, the method always returned ``None``.
Expand Down
0