The Python docs give warnings about trying to modify a dict while iterating over it. Does this apply to views?
I understand that views are "live" in the sense that if you change the underlying dict, the view automatically reflects the change. I'm also aware that a dict's natural ordering can change if elements are added or removed. How does this work in conjunction with for/in? Can you safely modify the dict without messing up the loop?
d = dict()
# assume populated dict
for k in d.viewkeys():
# possibly add or del element of d
Does the for/in loop iterate over all the new elements as well? Does it miss elements (because of order change)?