]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-102105 Fix wording in filterfalse/quantify/filter (GH-102189)
authorStefan Pochmann <609905+pochmann@users.noreply.github.com>
Fri, 24 Feb 2023 16:13:05 +0000 (17:13 +0100)
committerGitHub <noreply@github.com>
Fri, 24 Feb 2023 16:13:05 +0000 (10:13 -0600)
Doc/library/functions.rst
Doc/library/itertools.rst

index 3ff2884902515331911ef33727e81b994137f74d..f0f374771b0cf10e098e925d048d564d837363a8 100644 (file)
@@ -623,7 +623,7 @@ are always available.  They are listed here in alphabetical order.
 .. function:: filter(function, iterable)
 
    Construct an iterator from those elements of *iterable* for which *function*
-   returns true.  *iterable* may be either a sequence, a container which
+   is true.  *iterable* may be either a sequence, a container which
    supports iteration, or an iterator.  If *function* is ``None``, the identity
    function is assumed, that is, all elements of *iterable* that are false are
    removed.
@@ -634,7 +634,7 @@ are always available.  They are listed here in alphabetical order.
    ``None``.
 
    See :func:`itertools.filterfalse` for the complementary function that returns
-   elements of *iterable* for which *function* returns false.
+   elements of *iterable* for which *function* is false.
 
 
 .. class:: float(x=0.0)
index 8d83d92660d6ef1ba4489330775034022de4c6d6..95da7166842ee6985f6d6414779080dd4a961079 100644 (file)
@@ -398,7 +398,7 @@ loops that truncate the stream.
 .. function:: filterfalse(predicate, iterable)
 
    Make an iterator that filters elements from iterable returning only those for
-   which the predicate is ``False``. If *predicate* is ``None``, return the items
+   which the predicate is false. If *predicate* is ``None``, return the items
    that are false. Roughly equivalent to::
 
       def filterfalse(predicate, iterable):
@@ -831,7 +831,7 @@ which incur interpreter overhead.
        return next(g, True) and not next(g, False)
 
    def quantify(iterable, pred=bool):
-       "Count how many times the predicate is true"
+       "Count how many times the predicate is True"
        return sum(map(pred, iterable))
 
    def ncycles(iterable, n):