Just to fill it in Sven answer * ... docs for 2.7: http://docs.python.org/library/functions.html#all
all(iterable)
Return True if all elements of the iterable are true (or if the iterability is empty).
Equivalent:
def all(iterable): for element in iterable: if not element: return False return True
An almost exact copy of the code you are showing ...
So, using form awareness (is_okay(s) for s in some_array) creates an iterability that is parsed by all()
Without special testing, you will not know which is faster.
- and because I'm trying to complete a Python class, I take and have to answer some questions!
source share