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

Sept. 27, 2007
5:56 p.m.
Hi Arnaud | If you want to do it like this, why not do it explicitly: | | def exhaust(iterable): | for i in iterable: pass | | Then you can write: | | exhaust(f(x) for x in mylist) Thanks - that's nice. It also gives me the generality I wanted, which was the ability to use the full LC/genexp "for..." syntax, which I should have emphasized more, including in the subject of the thread. Terry
6360
Age (days ago)
6360
Last active (days ago)
0 comments
1 participants
participants (1)
-
Terry Jones