https://github.com/python/cpython/commit/0f7f5a4a6c2b9bffe973e4b36a217b5a0fbbc7bb
commit: 0f7f5a4a6c2b9bffe973e4b36a217b5a0fbbc7bb
branch: 3.11
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2024-02-26T09:59:32Z
summary:

[3.11] Doc: Clarify the return type of Event.wait when timeout is used 
(GH-104168) (GH-115939)

(cherry picked from commit 37f5d06b1bf830048c09ed967bb2cda945d56541)

Co-authored-by: Phil Elson <[email protected]>

files:
M Doc/library/threading.rst

diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
index d2c896eacd2e8c..180fe3b8988bb0 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -965,18 +965,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``.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to