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.
Created on 2013年11月28日 14:03 by cost6, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg204653 - (view) | Author: cost6 (cost6) | Date: 2013年11月28日 14:03 | |
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) |
|||
| msg204669 - (view) | Author: Matthew Barnett (mrabarnett) * (Python triager) | Date: 2013年11月28日 15:05 | |
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, instead, build a new collection and then the old one with the new one. |
|||
| msg204670 - (view) | Author: cost6 (cost6) | Date: 2013年11月28日 15:21 | |
Sorry for that, i will move it to python-list. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:54 | admin | set | github: 64022 |
| 2013年11月28日 15:21:43 | cost6 | set | status: open -> closed resolution: works for me messages: + msg204670 |
| 2013年11月28日 15:05:44 | mrabarnett | set | nosy:
+ mrabarnett messages: + msg204669 |
| 2013年11月28日 14:03:18 | cost6 | create | |