You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
for-each on list aborts earlier than expected #64022
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2013-11-28.15:21:43.492>created_at=<Date2013-11-28.14:03:18.228>labels= ['interpreter-core', 'type-bug']
title='for-each on list aborts earlier than expected'updated_at=<Date2013-11-28.15:21:43.491>user='https://bugs.python.org/cost6'
This issue is best posted to python-list and only posted here if it's agreed that it's a bug.
Anyway:
You have "self.flows" and "flows", but haven't said what they are.
It's recommended that you don't modify a collection while iterating over it, but, instead, build a new collection and then the old one with the new one.
Activity
cost6 commentedon Nov 28, 2013
for-each does not iterate over all entries of collection, if one removes elements during the iteration.
Example (misbehaving) code:
mrabarnett commentedon Nov 28, 2013
This issue is best posted to python-list and only posted here if it's agreed that it's a bug.
Anyway:
You have "self.flows" and "flows", but haven't said what they are.
It's recommended that you don't modify a collection while iterating over it, but, instead, build a new collection and then the old one with the new one.
cost6 commentedon Nov 28, 2013
Sorry for that, i will move it to python-list.