I have the following problem with python\'s \"all\" and generators:
G = (a for a in [0,1])
all(list(G)) # returns False - as I expected
B
I found out in python 3.2.3 if the value 0 is in the list all() will return False.
for all() to work you have to avoid having a zero in the iteration list.
It leads me to believe that zero is used as an end for the iteration.
Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] on win32
print(all([])) # prints True
print(all([0])) # prints False
print(all([2, 3])) # prints True
print(all([2, 3, 0])) # prints False