Serhiy Storchaka added the comment: Bad things happen not only when a list shrinks, but also when it grows during iteration.
The one solution is to check if the size is changed on every iteration. The other solution is to convert a list to a tuple for iterating. ---------- versions: +Python 2.7 -Python 3.4 Added file: http://bugs.python.org/file44838/issue24098-check-size.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24098> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com