I have a very strange bug and I can't see where I go wrong. I want to loop over a list of objects
objects = [<object 1>, <object 2>, <object 3>, <object 4>, <Query_Category 5>, <object 6>]
and I do a simple
for i, object in enumerate(objects):
print "delete ", object
objects.pop(i)
and the output is
delete <Query_Category 1>
delete <Query_Category 3>
delete <Query_Category 4>
delete <Query_Category 5>
delete <Query_Category 6>
so the loop ignored the second element? This result is reproducible, meaning if I run it again it leads to the same outcome??? This is probably not reproducible for you, since I guess this is caused by something strange in my code??? But I have no idea what to look for? Is there sum fundamental python principle I am missing here? thanks carl