updateWidgets() does not change self.widgets in place (which would be a problem), but replaces it with a new list. Links to the old are kept, at least until the for loop in workOnWidgets() completes, so this should not be a problem.
Simplified, what you do is something like this:
>>> l=[1,2,3] >>> for i in l: ... l=[] ... print(i) ... 1 2 3
However, you will have problems if you change the list you are repeating:
>>> l=[1,2,3] >>> for i in l: ... l[2]=0 ... print(i) ... 1 2 0
source share