Dominique Lederer wrote:
> hi
> 
> i want to delete objects in my container, for that i do
> 
> for xx in container.keys():
>   logging.info(xx)
>   del container[xx]
> 
> but only every second obj is deleted, the loop touches objects in this order:
> 1,3,5,7,.....
> 
> if i remove the del statement from the upper example, the loop works as 
> expected:
> 1,2,3,4,5,6...

oh, ok, i should not mess arround with the container keys while deleting from
the container ;)

i fixed it with:

for xx in [key for key in container.keys()]:
  del container[xx]
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to