Eric V. Smith <e...@trueblade.com> added the comment:
As you've seen, the example is correct. I made the same mistake earlier today. For others: see also #41891 for a suggestion to improve the documentation. As was pointed out in that issue, it's generally true in Python that you should not mutate a sequence while iterating over it. ---------- nosy: +eric.smith _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41899> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com