Skip to content

Commit

Permalink
pythongh-102105 Fix wording in filterfalse/quantify/filter (pythonGH-…
Browse files Browse the repository at this point in the history
…102189)

(cherry picked from commit 81bf10e)

Co-authored-by: Stefan Pochmann <609905+pochmann@users.noreply.github.com>
  • Loading branch information
miss-islington and pochmann authored Feb 24, 2023
1 parent dd0843a commit 3b4f8fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,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.
Expand All @@ -633,7 +633,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)
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/itertools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,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):
Expand Down Expand Up @@ -792,7 +792,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):
Expand Down

0 comments on commit 3b4f8fc

Please sign in to comment.