Nikolaus Rath added the comment:

Hmm. I see your point. You might be right (I'm not fully convinced yet though), 
but this bug is probably not a good place to go into more detail about this.

So what would be the best way to fix the immediate problem this was originally 
about? Raise a RuntimeError (as Armin suggested), or just end the iteration? 

Note that RuntimeError would only be raised when the current element is removed 
from the dict, and the ordered dict would still tolerate other kinds of 
modifications.

Both variants would also be a change from previous behavior (were removing the 
current elements works as long as you do not remove the next one as well).

The minimally intrusive change would be to skip over elements that have been 
removed, but that comes at the expense of an additional membership test in each 
iteration.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19414>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to