Stef Mientki <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> hello,
>
> I want to remove some items from a dictionary,
> so I would expect this should work:
>
> Nets = {}
> ... fill the dictionary Nets
>
> for net in Nets:
> if net.upper() in Eagle_Power_Nets :
> del Nets [ net ]
>
>
> But it gives me
> Message File Name Line Position
> Traceback
> ? D:\data_to_test\JALsPy\Eagle_import.py 380
> RuntimeError: dictionary changed size during iteration
>
>
> [snip...]
>
>
> thanks,
> Stef Mientki
I think that you need to find a different iteration condition. Using
for n in dict will iterate using an iterator which doesn't support
"parallel" deletions.
bests,
./alex
--
.w( the_mindstorm )p.
--
http://mail.python.org/mailman/listinfo/python-list