Skip to content

Commit 3b4f8fc

Browse files
gh-102105 Fix wording in filterfalse/quantify/filter (GH-102189)
(cherry picked from commit 81bf10e) Co-authored-by: Stefan Pochmann <[email protected]>
1 parent dd0843a commit 3b4f8fc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Doc/library/functions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ are always available. They are listed here in alphabetical order.
622622
.. function:: filter(function, iterable)
623623

624624
Construct an iterator from those elements of *iterable* for which *function*
625-
returns true. *iterable* may be either a sequence, a container which
625+
is true. *iterable* may be either a sequence, a container which
626626
supports iteration, or an iterator. If *function* is ``None``, the identity
627627
function is assumed, that is, all elements of *iterable* that are false are
628628
removed.
@@ -633,7 +633,7 @@ are always available. They are listed here in alphabetical order.
633633
``None``.
634634

635635
See :func:`itertools.filterfalse` for the complementary function that returns
636-
elements of *iterable* for which *function* returns false.
636+
elements of *iterable* for which *function* is false.
637637

638638

639639
.. class:: float(x=0.0)

Doc/library/itertools.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ loops that truncate the stream.
359359
.. function:: filterfalse(predicate, iterable)
360360

361361
Make an iterator that filters elements from iterable returning only those for
362-
which the predicate is ``False``. If *predicate* is ``None``, return the items
362+
which the predicate is false. If *predicate* is ``None``, return the items
363363
that are false. Roughly equivalent to::
364364

365365
def filterfalse(predicate, iterable):
@@ -792,7 +792,7 @@ which incur interpreter overhead.
792792
return next(g, True) and not next(g, False)
793793

794794
def quantify(iterable, pred=bool):
795-
"Count how many times the predicate is true"
795+
"Count how many times the predicate is True"
796796
return sum(map(pred, iterable))
797797

798798
def ncycles(iterable, n):

0 commit comments

Comments
 (0)