What is the most efficient way of applying a function to all the elements of an iterable while discarding the<br>result (i.e. operations are done only for side-effects).<br><br>For example if I want to save all elements in a list of items (and am not interested in what save() returns), the<br>

simplest way is:<br><br>itemlist = [i1, i2, i3....]<br>for item in itemlist: item.save()<br><br>It might be squeezing too much but is it possible to do it more efficiently by pushing the looping inside the C code<br>and achieve some gains as is done by using map in place of a for loop when the return values need to be saved?<br>

<br>Any suggestions will be appreciated.<br clear="all"><br>TIA<br><br>-- <br>Regards<br>Shashank Singh<br>Senior Undergraduate, Department of Computer Science and Engineering<br>Indian Institute of Technology Bombay<br>
<a href="mailto:shashank.sunny.singh@gmail.com">shashank.sunny.singh@gmail.com</a><br>
<a href="http://www.cse.iitb.ac.in/~shashanksingh">http://www.cse.iitb.ac.in/~shashanksingh</a><br>