I originally interpreted you to be testing identity ("the same item"), but you're really testing equality ("same value"). (If you were testing identity, use is instead of ==.)
def all_same(items):
it = iter(items)
for first in it:
break
else:
return True # empty case, note all([]) == True
return all(x == first for x in it)
The above works on any iterable, not just lists, otherwise you could use:
def all_same(L):
return all(x == L[0] for x in L)
(But, IMHO, you might as well use the general version—it works perfectly fine on lists.)