On 11/28/13 5:14 PM, Valentin Zahnd wrote:
2013/11/28 Ned Batchelder :
On 11/28/13 10:49 AM, Valentin Zahnd wrote:
Hello
For-each does not iterate ober all entries of collection, if one
removes elements during the iteration.
Example code:
def keepByValue(self, key=None, value=[]):
for
On Fri, Nov 29, 2013 at 9:14 AM, Valentin Zahnd wrote:
> def keepByValue(self, key=None, value=[]):
> tmpFlows = []
> while len(self.flows) > 0:
> row = self.flows.pop()
> if row[key] in value:
> tmpFlows.append(row)
> self
2013/11/28 Ned Batchelder :
> On 11/28/13 10:49 AM, Valentin Zahnd wrote:
>>
>> Hello
>>
>> For-each does not iterate ober all entries of collection, if one
>> removes elements during the iteration.
>>
>> Example code:
>>
>> def keepByValue(self, key=None, value=[]):
>> for row in self.flows:
On Thu, 28 Nov 2013 16:49:21 +0100, Valentin Zahnd wrote:
> It is clear why it behaves on that way. Every time one removes an
> element, the length of the colleciton decreases by one while the counter
> of the for each statement is not. The questions are:
> 1. Why does the interprete not uses a co
On 28/11/2013 17:20, Ned Batchelder wrote:
On 11/28/13 10:49 AM, Valentin Zahnd wrote:
Hello
For-each does not iterate ober all entries of collection, if one
removes elements during the iteration.
Example code:
def keepByValue(self, key=None, value=[]):
for row in self.flows:
if
Valentin Zahnd gmail.com> writes:
>
> Hello
>
> For-each does not iterate ober all entries of collection, if one
> removes elements during the iteration.
>
> Example code:
>
> def keepByValue(self, key=None, value=[]):
> for row in self.flows:
> if not row[key] in value:
>
On 11/28/13 10:49 AM, Valentin Zahnd wrote:
Hello
For-each does not iterate ober all entries of collection, if one
removes elements during the iteration.
Example code:
def keepByValue(self, key=None, value=[]):
for row in self.flows:
if not row[key] in value:
self.fl
Hello
For-each does not iterate ober all entries of collection, if one
removes elements during the iteration.
Example code:
def keepByValue(self, key=None, value=[]):
for row in self.flows:
if not row[key] in value:
self.flows.remove(row)
It is clear why it behaves on th