This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.smith
Recipients eric.smith, paul.moore, sreedevi.ha, steve.dower, terry.reedy, tim.golden, zach.ware
Date 2020-09-12.16:27:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1599928043.8.0.622580905272.issue41774@roundup.psfhosted.org>
In-reply-to
Content
You should not mutate a list while iterating over it.

See, for example https://stackoverflow.com/questions/6260089/strange-result-when-removing-item-from-a-list

I couldn't find a place where this is mentioned in the python list docs. If it's not there, we should add something to the programming FAQ.
History
Date User Action Args
2020-09-12 16:27:23eric.smithsetrecipients: + eric.smith, terry.reedy, paul.moore, tim.golden, zach.ware, steve.dower, sreedevi.ha
2020-09-12 16:27:23eric.smithsetmessageid: <1599928043.8.0.622580905272.issue41774@roundup.psfhosted.org>
2020-09-12 16:27:23eric.smithlinkissue41774 messages
2020-09-12 16:27:23eric.smithcreate