[Python-ideas] Calling a function of a list without accumulating results

Lucio Torre lucio.torre at gmail.com
Thu Sep 27 20:06:12 CEST 2007


On 9/27/07, Arnaud Delobelle <arno at marooned.org.uk> wrote:
>
> >
> >     for x in mylist:
> >         f(x)
> >
> >
> >     [f(x) for x in mylist]
> >
>

am i missing something or the one-liner syntax is great for this?

for x in mylist: f(x)

lucio.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20070927/48ffaa4f/attachment.html>


More information about the Python-ideas mailing list