> "Lawrence D'Oliveiro" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>>
>> 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

En Sun, 09 Sep 2007 22:58:54 -0300, bambam <[EMAIL PROTECTED]> escribi�:

> 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.

Then use [:] to *replace* all the old list items, do not merely rebind the  
name. That last statement
should be, instead:

devs[:] = newdevs

(Please don't top-post)

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to