summaryrefslogtreecommitdiffstats
path: root/Doc/library/threading.rst
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-11-12 14:57:03 (GMT)
committerGitHub <noreply@github.com>2019-11-12 14:57:03 (GMT)
commit138ccbb02216ca086047c3139857fb44f3dab1f9 (patch)
tree650ba3584d4d173fe36d757063909a09f239ebf2 /Doc/library/threading.rst
parent9a13a388f202268dd7b771638adbec132449b98b (diff)
downloadcpython-138ccbb02216ca086047c3139857fb44f3dab1f9.zip
cpython-138ccbb02216ca086047c3139857fb44f3dab1f9.tar.gz
cpython-138ccbb02216ca086047c3139857fb44f3dab1f9.tar.bz2
bpo-38738: Fix formatting of True and False. (GH-17083)
* "Return true/false" is replaced with "Return ``True``/``False``" if the function actually returns a bool. * Fixed formatting of some True and False literals (now in monospace). * Replaced "True/False" with "true/false" if it can be not only bool. * Replaced some 1/0 with True/False if it corresponds the code. * "Returns <bool>" is replaced with "Return <bool>".
Diffstat (limited to 'Doc/library/threading.rst')
-rw-r--r--Doc/library/threading.rst22
1 files changed, 11 insertions, 11 deletions
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
index 905862e..9a68491 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -543,15 +543,15 @@ Reentrant locks also support the :ref:`context management protocol <with-locks>`
There is no return value in this case.
When invoked with the *blocking* argument set to true, do the same thing as when
- called without arguments, and return true.
+ called without arguments, and return ``True``.
When invoked with the *blocking* argument set to false, do not block. If a call
- without an argument would block, return false immediately; otherwise, do the
- same thing as when called without arguments, and return true.
+ without an argument would block, return ``False`` immediately; otherwise, do the
+ same thing as when called without arguments, and return ``True``.
When invoked with the floating-point *timeout* argument set to a positive
value, block for at most the number of seconds specified by *timeout*
- and as long as the lock cannot be acquired. Return true if the lock has
+ and as long as the lock cannot be acquired. Return ``True`` if the lock has
been acquired, false if the timeout has elapsed.
.. versionchanged:: 3.2
@@ -784,20 +784,20 @@ Semaphores also support the :ref:`context management protocol <with-locks>`.
When invoked without arguments:
* If the internal counter is larger than zero on entry, decrement it by
- one and return true immediately.
+ one and return ``True`` immediately.
* If the internal counter is zero on entry, block until awoken by a call to
:meth:`~Semaphore.release`. Once awoken (and the counter is greater
- than 0), decrement the counter by 1 and return true. Exactly one
+ than 0), decrement the counter by 1 and return ``True``. Exactly one
thread will be awoken by each call to :meth:`~Semaphore.release`. The
order in which threads are awoken should not be relied on.
When invoked with *blocking* set to false, do not block. If a call
- without an argument would block, return false immediately; otherwise, do
- the same thing as when called without arguments, and return true.
+ without an argument would block, return ``False`` immediately; otherwise, do
+ the same thing as when called without arguments, and return ``True``.
When invoked with a *timeout* other than ``None``, it will block for at
most *timeout* seconds. If acquire does not complete successfully in
- that interval, return false. Return true otherwise.
+ that interval, return ``False``. Return ``True`` otherwise.
.. versionchanged:: 3.2
The *timeout* parameter is new.
@@ -877,7 +877,7 @@ method. The :meth:`~Event.wait` method blocks until the flag is true.
.. method:: is_set()
- Return true if and only if the internal flag is true.
+ Return ``True`` if and only if the internal flag is true.
.. method:: set()
@@ -901,7 +901,7 @@ method. The :meth:`~Event.wait` method blocks until the flag is true.
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
+ 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.