I have a list a for which I want to change the elements a[i: j] according to a function f. Can I do better than the naive way?
for index in range(i, j):
a[index] = f(a)
[By better I mean something closer to map(f, a), or something faster.]
You can assign to the slice: