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)

----------
components: Interpreter Core
messages: 204653
nosy: cost6
priority: normal
severity: normal
status: open
title: for-each on list aborts earlier than expected
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19823>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to