Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.10] bpo-45346: Keep docs consistent regarding true and false values (GH-28697) #28698

Merged
merged 1 commit into from
Oct 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/library/ast.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down
8 changes: 4 additions & 4 deletions Doc/reference/compound_stmts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1861,7 +1861,7 @@ def test_warning_notimplemented(self):
# 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)
Expand Down