2 Answers
2

This has the advantage of kicking out early if any of the elements is too large. This works because the ... for ... in list is an instance of Python's powerful and multifarious generator expressions. They are similar to list comprehensions but only generate values as needed.

all itself just checks to see if all of the values in the iterable it's passed are true. Generator expressions, list comprehensions, lists, tuples, and other sorts of sequences are all iterables.

So the first statement ends up being equivalent to calling a function like