You can modify a list you're iterating over if you use indices explicitly:
def remove_adjacent(l):
if len(l)<2:
return l
prev,i = l[0],1
while i < len(l):
if l[i] == prev:
del l[i]
else:
prev = l[i]
i += 1
It doesn't work with iterators because iterators don't "know" how to modify the index when you remove arbitrary elements, so it's easier to just forbid it. Some languages have iterators with functions to remove the "current item".