List iterator thread safety

Emanuele D'Arrigo manu3d at gmail.com
Thu Aug 27 08:03:07 EDT 2009


On Aug 27, 2:01 am, a... at 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 are in front of the current iterator position. Somehow I can't
quite prove to myself if this is possible or not over multiple
threads. I.e. a dictionary will throw an exception about the object
changing size while iterating through it. A list doesn't, hence the
question.

Manu




More information about the Python-list mailing list