Skip to content

Commit 81bf10e

Browse files
authored
gh-102105 Fix wording in filterfalse/quantify/filter (GH-102189)
1 parent e5e1c1f commit 81bf10e

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
@@ -623,7 +623,7 @@ are always available. They are listed here in alphabetical order.
623623
.. function:: filter(function, iterable)
624624

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

636636
See :func:`itertools.filterfalse` for the complementary function that returns
637-
elements of *iterable* for which *function* returns false.
637+
elements of *iterable* for which *function* is false.
638638

639639

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

Doc/library/itertools.rst

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

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

404404
def filterfalse(predicate, iterable):
@@ -831,7 +831,7 @@ which incur interpreter overhead.
831831
return next(g, True) and not next(g, False)
832832

833833
def quantify(iterable, pred=bool):
834-
"Count how many times the predicate is true"
834+
"Count how many times the predicate is True"
835835
return sum(map(pred, iterable))
836836

837837
def ncycles(iterable, n):

0 commit comments

Comments
 (0)