Nikolaus Rath added the comment: I have attached a patch that fixes this issue. Looking at Raymonds comments in issue 19332, I have kept new code out of the critical path in __iter__ and instead modified the __delitem__ method (I assume that an element is removed only once, but may be iterated over many times). The updated __delitem__ now also updates the prev and next links of the removed item itself. When the current item is removed during an iteration, the iteration thus stops.
I hope that's an acceptable solution. ---------- keywords: +patch Added file: http://bugs.python.org/file33359/issue19414.diff _______________________________________ 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