On Thursday 27 August 2009 16:50:16 Carl Banks wrote:
> On Aug 27, 7:25 am, Hendrik van Rooyen
> wrote:
> > Its not too bad - if you crook a bit - the trick is that you iterate over
> > the list backwards when you are removing stuff based on index, so that
> > the remainder does not get jumbled u
On Aug 27, 7:25 am, Hendrik van Rooyen
wrote:
> On Thursday 27 August 2009 15:26:04 Carl Banks wrote:
>
> > Deleting items from a list while iterating over it is a bad idea,
> > exceptions or not.
>
> > Hmm, this sounds like something someone might do for a game. You have
> > a list of objects, a
On Thursday 27 August 2009 15:26:04 Carl Banks wrote:
> Deleting items from a list while iterating over it is a bad idea,
> exceptions or not.
>
> Hmm, this sounds like something someone might do for a game. You have
> a list of objects, and in a given time step you have to iterate
> through the
On Aug 27, 5:03 am, "Emanuele D'Arrigo" wrote:
> On Aug 27, 2:01 am, a...@pythoncraft.com (Aahz) wrote:
>
> > Well, I'm not sure about exceptions, but you almost certainly won't get
> > the results you want.
>
> What I'd like in this context is to iterate through the items in the
> list without pr
On Tue, Aug 25, 2009 at 3:43 AM, Emanuele D'Arrigo wrote:
> Let's say I have a list accessed by two threads, one removing list
> items via "del myList[index]" statement the other iterating through
> the list and printing out the items via "for item in myList:"
> statement.
I tried something sim
Emanuele D'Arrigo wrote:
> On Aug 27, 2:01 am, a...@pythoncraft.com (Aahz) wrote:
>> Well, I'm not sure about exceptions, but you almost certainly won't get
>> the results you want.
>
> What I'd like in this context is to iterate through the items in the
> list without processing the same item tw
On Aug 27, 2:01 am, a...@pythoncraft.com (Aahz) wrote:
> Well, I'm not sure about exceptions, but you almost certainly won't get
> the results you want.
What I'd like in this context is to iterate through the items in the
list without processing the same item twice and without skipping item
that a
In article ,
Emanuele D'Arrigo wrote:
>
>Let's say I have a list accessed by two threads, one removing list
>items via "del myList[index]" statement the other iterating through
>the list and printing out the items via "for item in myList:"
>statement. Am I right to say this -won't- generate except
Let's say I have a list accessed by two threads, one removing list
items via "del myList[index]" statement the other iterating through
the list and printing out the items via "for item in myList:"
statement. Am I right to say this -won't- generate exceptions because
the list iterator is not concern