From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 24 Feb 2023 16:21:40 +0000 (-0800) Subject: gh-102105 Fix wording in filterfalse/quantify/filter (GH-102189) X-Git-Tag: v3.11.3~114 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3b4f8fc83dcea1a9d0bc5bd33592e5a3da41fa71;p=thirdparty%2FPython%2Fcpython.git gh-102105 Fix wording in filterfalse/quantify/filter (GH-102189) (cherry picked from commit 81bf10e4f20a0f6d36b67085eefafdf7ebb97c33) Co-authored-by: Stefan Pochmann <609905+pochmann@users.noreply.github.com> --- diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index d0da05f78416..22972c038750 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -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. @@ -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) diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 06c73fc23490..2fd30db0587f 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -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): @@ -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):