Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eacdec6

Browse files
committed
Update the filter() and list() descriptions to include information about
the support for containers and iteration.
1 parent 93656e7 commit eacdec6

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

Doc/lib/libfuncs.tex

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,13 @@ \section{Built-in Functions \label{built-in-funcs}}
234234
\end{funcdesc}
235235

236236
\begin{funcdesc}{filter}{function, list}
237-
Construct a list from those elements of \var{list} for which
238-
\var{function} returns true. If \var{list} is a string or a tuple,
239-
the result also has that type; otherwise it is always a list. If
240-
\var{function} is \code{None}, the identity function is assumed,
241-
i.e.\ all elements of \var{list} that are false (zero or empty) are
242-
removed.
237+
Construct a list from those elements of \var{list} for which
238+
\var{function} returns true. \var{list} may be either a sequence, a
239+
container which supports iteration, or an iterator, If \var{list}
240+
is a string or a tuple, the result also has that type; otherwise it
241+
is always a list. If \var{function} is \code{None}, the identity
242+
function is assumed, i.e.\ all elements of \var{list} that are false
243+
(zero or empty) are removed.
243244
\end{funcdesc}
244245

245246
\begin{funcdesc}{float}{x}
@@ -378,12 +379,13 @@ \section{Built-in Functions \label{built-in-funcs}}
378379
\end{funcdesc}
379380

380381
\begin{funcdesc}{list}{sequence}
381-
Return a list whose items are the same and in the same order as
382-
\var{sequence}'s items. If \var{sequence} is already a list,
383-
a copy is made and returned, similar to \code{\var{sequence}[:]}.
384-
For instance, \code{list('abc')} returns
385-
returns \code{['a', 'b', 'c']} and \code{list( (1, 2, 3) )} returns
386-
\code{[1, 2, 3]}.
382+
Return a list whose items are the same and in the same order as
383+
\var{sequence}'s items. \var{sequence} may be either a sequence, a
384+
container that supports iteration, or an iterator object. If
385+
\var{sequence} is already a list, a copy is made and returned,
386+
similar to \code{\var{sequence}[:]}. For instance,
387+
\code{list('abc')} returns \code{['a', 'b', 'c']} and \code{list(
388+
(1, 2, 3) )} returns \code{[1, 2, 3]}.
387389
\end{funcdesc}
388390

389391
\begin{funcdesc}{locals}{}

0 commit comments

Comments
 (0)