[issue19823] for-each on list aborts earlier than expected

2013-11-28 Thread cost6
cost6 added the comment: Sorry for that, i will move it to python-list. -- resolution: -> works for me status: open -> closed ___ Python tracker ___

[issue19823] for-each on list aborts earlier than expected

2013-11-28 Thread Matthew Barnett
Matthew Barnett added the comment: This issue is best posted to python-list and only posted here if it's agreed that it's a bug. Anyway: 1. You have "self.flows" and "flows", but haven't said what they are. 2. It's recommended that you don't modify a collection while iterating over it, but,

[issue19823] for-each on list aborts earlier than expected

2013-11-28 Thread cost6
New submission from cost6: for-each does not iterate over all entries of collection, if one removes elements during the iteration. Example (misbehaving) code: def keepByValue(self, key=None, value=[]): for row in self.flows: if not row[key] in value: flows.remove(row)