aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-10-02 12:32:56 -0700
committerPablo Galindo <pablogsal@gmail.com>2021-10-04 00:41:24 +0100
commit49fac92173d2c6cc3bd42a2355824e13272a3a7d (patch)
tree06a04c079221fe04da5cb5dcad2604c9f7394951
parent[3.10] Remove trailing spaces (GH-28709) (diff)
downloadcpython-49fac92173d2c6cc3bd42a2355824e13272a3a7d.tar.gz
cpython-49fac92173d2c6cc3bd42a2355824e13272a3a7d.tar.bz2
cpython-49fac92173d2c6cc3bd42a2355824e13272a3a7d.zip
bpo-45346: Keep docs consistent regarding true and false values (GH-28697) (GH-28698)
-rw-r--r--Doc/library/ast.rst2
-rw-r--r--Doc/reference/compound_stmts.rst8
-rw-r--r--Lib/test/test_builtin.py2
3 files changed, 6 insertions, 6 deletions
diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst
index e21151bd4ef..d84c841fa4a 100644
--- a/Doc/library/ast.rst
+++ b/Doc/library/ast.rst
@@ -1266,7 +1266,7 @@ Pattern matching
the pattern matches the subject.
``body`` contains a list of nodes to execute if the pattern matches and
- the result of evaluating the guard expression is truthy.
+ the result of evaluating the guard expression is true.
.. doctest::
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst
index 25abc1be6a5..41719be3dc9 100644
--- a/Doc/reference/compound_stmts.rst
+++ b/Doc/reference/compound_stmts.rst
@@ -585,8 +585,8 @@ Here's an overview of the logical flow of a match statement:
#. If the pattern succeeds, the corresponding guard (if present) is evaluated. In
this case all name bindings are guaranteed to have happened.
- * If the guard evaluates as truthy or missing, the ``block`` inside ``case_block`` is
- executed.
+ * If the guard evaluates as true or is missing, the ``block`` inside
+ ``case_block`` is executed.
* Otherwise, the next ``case_block`` is attempted as described above.
@@ -637,10 +637,10 @@ The logical flow of a ``case`` block with a ``guard`` follows:
#. If the pattern succeeded, evaluate the ``guard``.
- * If the ``guard`` condition evaluates to "truthy", the case block is
+ * If the ``guard`` condition evaluates as true, the case block is
selected.
- * If the ``guard`` condition evaluates to "falsy", the case block is not
+ * If the ``guard`` condition evaluates as false, the case block is not
selected.
* If the ``guard`` raises an exception during evaluation, the exception
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index bd8353d038b..6dc4fa55502 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -1861,7 +1861,7 @@ class BuiltinTest(unittest.TestCase):
# be evaluated in a boolean context (virtually all such use cases
# are a result of accidental misuse implementing rich comparison
# operations in terms of one another).
- # For the time being, it will continue to evaluate as truthy, but
+ # For the time being, it will continue to evaluate as a true value, but
# issue a deprecation warning (with the eventual intent to make it
# a TypeError).
self.assertWarns(DeprecationWarning, bool, NotImplemented)