Skip to content

Commit db91b05

Browse files
authored
bpo-45346: Keep docs consistent regarding true and false values (GH-28697)
1 parent 0742abd commit db91b05

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Doc/library/ast.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ Pattern matching
12661266
the pattern matches the subject.
12671267

12681268
``body`` contains a list of nodes to execute if the pattern matches and
1269-
the result of evaluating the guard expression is truthy.
1269+
the result of evaluating the guard expression is true.
12701270

12711271
.. doctest::
12721272

Doc/reference/compound_stmts.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,8 @@ Here's an overview of the logical flow of a match statement:
585585
#. If the pattern succeeds, the corresponding guard (if present) is evaluated. In
586586
this case all name bindings are guaranteed to have happened.
587587

588-
* If the guard evaluates as truthy or missing, the ``block`` inside ``case_block`` is
589-
executed.
588+
* If the guard evaluates as true or is missing, the ``block`` inside
589+
``case_block`` is executed.
590590

591591
* Otherwise, the next ``case_block`` is attempted as described above.
592592

@@ -637,10 +637,10 @@ The logical flow of a ``case`` block with a ``guard`` follows:
637637

638638
#. If the pattern succeeded, evaluate the ``guard``.
639639

640-
* If the ``guard`` condition evaluates to "truthy", the case block is
640+
* If the ``guard`` condition evaluates as true, the case block is
641641
selected.
642642

643-
* If the ``guard`` condition evaluates to "falsy", the case block is not
643+
* If the ``guard`` condition evaluates as false, the case block is not
644644
selected.
645645

646646
* If the ``guard`` raises an exception during evaluation, the exception

Lib/test/test_builtin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1861,7 +1861,7 @@ def test_warning_notimplemented(self):
18611861
# be evaluated in a boolean context (virtually all such use cases
18621862
# are a result of accidental misuse implementing rich comparison
18631863
# operations in terms of one another).
1864-
# For the time being, it will continue to evaluate as truthy, but
1864+
# For the time being, it will continue to evaluate as a true value, but
18651865
# issue a deprecation warning (with the eventual intent to make it
18661866
# a TypeError).
18671867
self.assertWarns(DeprecationWarning, bool, NotImplemented)

0 commit comments

Comments
 (0)