I would like to know what\'s the general behaviour of an iterator if the underlaying object changes during the iteration.
Using a simple mutable list, it seems obvi
There are some iterators that can yield more data even after a StopIteration has been raised; such iterators are considered broken.
StopIteration
This does not mean the iterator is at fault -- it means that if you use such an iterator without caution you can end up with bugs and broken code.