Python builtin "all" with generators
<p>I have the following problem with python's "all" and generators:</p>

<pre><code>G = (a for a in [0,1])
all(list(G))   # returns False - as I expected
</code></pre>

<p>But:</p>

<pre><code>G = (a for a in [0,1])
all(G)         # returns True!
</code></pre>

<p>Can anybody explain that?</p>

<p>UPDATE:
I swear I get this! Check this out:</p>

<pre><code>In [1]: G = (a for a in [0,1])

In [2]: all(G)
Out[2]: True
</code></pre>

<p>I am using Python 2.6.6 with IPython 0.10.2, all installed within the Python(x,y) package. Strangely enough, I get "True" (above) when I use the Spider IDE, and "False" in pure console...</p>

<p>UPDATE 2:
As DMS pointed out, it seems to be a numpy problem. Python(x,y) loads numpy, and all(G) was actually calling numpy.all(G) rather then the builtin all(). A quick workaround is to write:</p>

<pre><code>__builtins__.all(G)
</code></pre>

<p>Thank you all for your help!</p>

<p>-maciej</p>
