In line:
for p in srcPts[1:]:
slicing creates a new copy of scrPtrs, therefore a fixed size.
Disclaimer: it is not correct to modify a list that is an iterator, but this works ...
Creating an iterator over a list prevents copying and allows you to add and paste elements:
L = [1,2,2,3,4,5,2,2,6] it = iter(L) next(it)
Output:
2 7 2 7 3 4 5 2 7 2 7 6
source share