Skip to content

Commit 46a116c

Browse files
authored
bpo-38738: Fix formatting of True and False in the threading documentation (GH-31678)
* Fix formatting of True and False in the threading documentation * Update threading.rst
1 parent c4d2d57 commit 46a116c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Doc/library/threading.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,8 @@ since it is impossible to detect the termination of alien threads.
441441

442442
.. attribute:: daemon
443443

444-
A boolean value indicating whether this thread is a daemon thread (True)
445-
or not (False). This must be set before :meth:`~Thread.start` is called,
444+
A boolean value indicating whether this thread is a daemon thread (``True``)
445+
or not (``False``). This must be set before :meth:`~Thread.start` is called,
446446
otherwise :exc:`RuntimeError` is raised. Its initial value is inherited
447447
from the creating thread; the main thread is not a daemon thread and
448448
therefore all threads created in the main thread default to
@@ -516,7 +516,7 @@ All methods are executed atomically.
516516
value, block for at most the number of seconds specified by *timeout*
517517
and as long as the lock cannot be acquired. A *timeout* argument of ``-1``
518518
specifies an unbounded wait. It is forbidden to specify a *timeout*
519-
when *blocking* is false.
519+
when *blocking* is ``False``.
520520

521521
The return value is ``True`` if the lock is acquired successfully,
522522
``False`` if not (for example if the *timeout* expired).
@@ -544,7 +544,7 @@ All methods are executed atomically.
544544

545545
.. method:: locked()
546546

547-
Return true if the lock is acquired.
547+
Return ``True`` if the lock is acquired.
548548

549549

550550

@@ -593,17 +593,17 @@ Reentrant locks also support the :ref:`context management protocol <with-locks>`
593593
is unlocked, only one at a time will be able to grab ownership of the lock.
594594
There is no return value in this case.
595595

596-
When invoked with the *blocking* argument set to true, do the same thing as when
596+
When invoked with the *blocking* argument set to ``True``, do the same thing as when
597597
called without arguments, and return ``True``.
598598

599-
When invoked with the *blocking* argument set to false, do not block. If a call
599+
When invoked with the *blocking* argument set to ``False``, do not block. If a call
600600
without an argument would block, return ``False`` immediately; otherwise, do the
601601
same thing as when called without arguments, and return ``True``.
602602

603603
When invoked with the floating-point *timeout* argument set to a positive
604604
value, block for at most the number of seconds specified by *timeout*
605605
and as long as the lock cannot be acquired. Return ``True`` if the lock has
606-
been acquired, false if the timeout has elapsed.
606+
been acquired, ``False`` if the timeout has elapsed.
607607

608608
.. versionchanged:: 3.2
609609
The *timeout* parameter is new.
@@ -844,7 +844,7 @@ Semaphores also support the :ref:`context management protocol <with-locks>`.
844844
thread will be awoken by each call to :meth:`~Semaphore.release`. The
845845
order in which threads are awoken should not be relied on.
846846

847-
When invoked with *blocking* set to false, do not block. If a call
847+
When invoked with *blocking* set to ``False``, do not block. If a call
848848
without an argument would block, return ``False`` immediately; otherwise, do
849849
the same thing as when called without arguments, and return ``True``.
850850

0 commit comments

Comments
 (0)