A high-performance solution to the "are all elements of an iterable equal" problem

I don’t think the solutions using itertools are unreadable, and I also don’t care so much if they are. If the method name is clear, a fast but subtle implementation is fine, just document it carefully.

I for one am. If a general-purpose function that performed as fast as an existing solution for this problem and had other real-world uses were proposed, that would be interesting, but making one that realistically is only useful for all_equal does not seem valuable.

2 Likes