I can try that, but I'm not sure that it will work. The problem is that devList is just a pointer to a list owned by someone else. Making devList point to a new list won't work: I need to make the parent list different. I could do this by adding an extra level of indirection, but I think at the risk making the call environment more complex.
Still, the main thing is that I hadn't even thought of doing it that way. Thank you, Steve. "Lawrence D'Oliveiro" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > In message <[EMAIL PROTECTED]>, bambam wrote: > >> The devices are in a list, and are removed by using pop(i). This >> messes up the loop iteration, so it is actually done by setting a >> flag on each device in the exception handler, with ANOTHER >> loop after each write/read/calculate sequence. > > Why not just build a new list? E.g. > > newdevs = [] > for dev in devs : > ... > if not removing_dev : > newdevs.append(dev) > #end if > #end for > devs = newdevs -- http://mail.python.org/mailman/listinfo/python-list