Skip to content

Commit fa69ec8

Browse files
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 (cherry picked from commit 46a116c) Co-authored-by: Géry Ogam <[email protected]>
1 parent bdce188 commit fa69ec8

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
@@ -428,8 +428,8 @@ since it is impossible to detect the termination of alien threads.
428428

429429
.. attribute:: daemon
430430

431-
A boolean value indicating whether this thread is a daemon thread (True)
432-
or not (False). This must be set before :meth:`~Thread.start` is called,
431+
A boolean value indicating whether this thread is a daemon thread (``True``)
432+
or not (``False``). This must be set before :meth:`~Thread.start` is called,
433433
otherwise :exc:`RuntimeError` is raised. Its initial value is inherited
434434
from the creating thread; the main thread is not a daemon thread and
435435
therefore all threads created in the main thread default to
@@ -503,7 +503,7 @@ All methods are executed atomically.
503503
value, block for at most the number of seconds specified by *timeout*
504504
and as long as the lock cannot be acquired. A *timeout* argument of ``-1``
505505
specifies an unbounded wait. It is forbidden to specify a *timeout*
506-
when *blocking* is false.
506+
when *blocking* is ``False``.
507507

508508
The return value is ``True`` if the lock is acquired successfully,
509509
``False`` if not (for example if the *timeout* expired).
@@ -531,7 +531,7 @@ All methods are executed atomically.
531531

532532
.. method:: locked()
533533

534-
Return true if the lock is acquired.
534+
Return ``True`` if the lock is acquired.
535535

536536

537537

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

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

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

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

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

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

0 commit comments

Comments
 (0)