Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked frompython/cpython

Commit46a116c

Browse files
authored
bpo-38738: Fix formatting of True and False in the threading documentation (pythonGH-31678)
* Fix formatting of True and False in the threading documentation* Update threading.rst
1 parentc4d2d57 commit46a116c

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* isfalse.
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-
Returntrue 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 totrue, 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 tofalse, 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 tofalse, 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)

[8]ページ先頭

©2009-2025 Movatter.jp