Modifying list elements in a for loop
<p>I have a list <code>a</code> for which I want to change the elements <code>a[i: j]</code> according to a function <code>f</code>. Can I do better than the naive way?</p>

<pre><code>for index in range(i, j):
    a[index] = f(a)
</code></pre>

<p>[By better I mean something closer to <code>map(f, a)</code>, or something faster.]</p>
