Without additional information about functions, the results len(functions) * len(values)
possible function calls should be considered independent of each other, so there is no faster way than checking them all.
You can write this a little more succinctly, though:
any(f(v) for v in values for f in functions)
The built-in function any()
as short-circuited as the source code.
Change It turns out that the desired equivalent would be
all(any(f(v) for f in functions) for v in values)
See discussion comments.
source share