I don't think that does what you think it does:
>>> reduce(lambda a, b: len(a) == len(b), ["a", "b", "c"])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 1, in <lambda>
TypeError: object of type 'bool' has no len()
It's trying to do len(len("a") == len("b")) == len("c"), which becomes len(True) == len("c"), and len(True) doesn't work.Some variations which do work are:
len(set(map(len, ls))) == 1
len(set(len(x) for x in ls)) == 1
all(len(ls[0]) == len(x) for x in ls)
len(min(ls, key=len)) == len(max(ls, key=len))
Append "if ls else True" to handle the empty list.