mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Patch #1517490: fix glitches in filter() docs.
This commit is contained in:
parent
add191118f
commit
f41beacecb
1 changed files with 4 additions and 4 deletions
|
@ -468,10 +468,10 @@ class C:
|
||||||
Construct a list from those elements of \var{list} for which
|
Construct a list from those elements of \var{list} for which
|
||||||
\var{function} returns true. \var{list} may be either a sequence, a
|
\var{function} returns true. \var{list} may be either a sequence, a
|
||||||
container which supports iteration, or an iterator, If \var{list}
|
container which supports iteration, or an iterator, If \var{list}
|
||||||
is a string or a tuple, the result also has that type; otherwise it
|
is a string (either \code{str} or \code{unicode}) or a tuple, the result
|
||||||
is always a list. If \var{function} is \code{None}, the identity
|
also has that type; otherwise it is always a list. If \var{function} is
|
||||||
function is assumed, that is, all elements of \var{list} that are false
|
\code{None}, the identity function is assumed, that is, all elements of
|
||||||
(zero or empty) are removed.
|
\var{list} that are false are removed.
|
||||||
|
|
||||||
Note that \code{filter(function, \var{list})} is equivalent to
|
Note that \code{filter(function, \var{list})} is equivalent to
|
||||||
\code{[item for item in \var{list} if function(item)]} if function is
|
\code{[item for item in \var{list} if function(item)]} if function is
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue