I want the results of the function to be:
Piggybacking on Ignacio Vasquez-Abram's method, but will stop after first mismatch:
def unanimous(s):
it1, it2 = itertools.tee(iter(s))
it1.next()
return not any(bool(a)^bool(b) for a,b in itertools.izip(it1,it2))
While using not reduce(operators.xor, s)
would be simpler, it does no short-circuiting.