<p dir="auto">The problem is that you can shoot yourself in the foot with the numpy version of <code class="notranslate">all</code>, because it is not consistent with the Python build-in <code class="notranslate">all</code> in return value when generator is passed to it:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [1]: import numpy

In [2]: numpy.all(a for a in [False])
Out[2]: &lt;generator object &lt;genexpr&gt; at 0x7f22623eeaa0&gt;

In [3]: bool(numpy.all(a for a in [False]))
Out[3]: True

In [4]: __builtin__.all(a for a in [False])
Out[4]: False"><pre class="notranslate"><code class="notranslate">In [1]: import numpy

In [2]: numpy.all(a for a in [False])
Out[2]: &lt;generator object &lt;genexpr&gt; at 0x7f22623eeaa0&gt;

In [3]: bool(numpy.all(a for a in [False]))
Out[3]: True

In [4]: __builtin__.all(a for a in [False])
Out[4]: False
</code></pre></div>
<p dir="auto">This is especially confusing when used with <code class="notranslate">ipython -pylab</code> in which case the <strong>buildin</strong>.all is shadowed with the numpy one:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ipython -pylab
... blah blah...
In [2]: all.func_code
Out[2]: &lt;code object all at 0x7ff967d8c5b0, file &quot;/usr/lib64/python2.7/site-packages
numpy/core/fromnumeric.py&quot;, line 1842&gt;"><pre class="notranslate"><code class="notranslate">$ ipython -pylab
... blah blah...
In [2]: all.func_code
Out[2]: &lt;code object all at 0x7ff967d8c5b0, file "/usr/lib64/python2.7/site-packages
numpy/core/fromnumeric.py", line 1842&gt;
</code></pre></div>
<p dir="auto">Numpy's any() (and all()) functions should work with generator expressions to be consistent with basic python.  I spent several hours trying to debug a case of this, which would work if I used a list, but not if I used a generator expression -- only to discover that it was because numpy's all() function was being used instead of the usual python one that works identically with both generators and lists.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="lst = [0,1,2]

print any(i &lt; 0 for i in lst) # False
from numpy import any
print any([i &lt; 0 for i in lst]) # False
print any(i &lt; 0 for i in lst) # &lt;generator object &lt;genexpr&gt; at 0x1006bd500&gt;"><pre class="notranslate"><span class="pl-s1">lst</span> <span class="pl-c1">=</span> [<span class="pl-c1">0</span>,<span class="pl-c1">1</span>,<span class="pl-c1">2</span>]

<span class="pl-k">print</span> <span class="pl-en">any</span>(<span class="pl-s1">i</span> <span class="pl-c1">&lt;</span> <span class="pl-c1">0</span> <span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-s1">lst</span>) <span class="pl-c"># False</span>
<span class="pl-k">from</span> <span class="pl-s1">numpy</span> <span class="pl-k">import</span> <span class="pl-s1">any</span>
<span class="pl-k">print</span> <span class="pl-en">any</span>([<span class="pl-s1">i</span> <span class="pl-c1">&lt;</span> <span class="pl-c1">0</span> <span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-s1">lst</span>]) <span class="pl-c"># False</span>
<span class="pl-k">print</span> <span class="pl-en">any</span>(<span class="pl-s1">i</span> <span class="pl-c1">&lt;</span> <span class="pl-c1">0</span> <span class="pl-k">for</span> <span class="pl-s1">i</span> <span class="pl-c1">in</span> <span class="pl-s1">lst</span>) <span class="pl-c"># &lt;generator object &lt;genexpr&gt; at 0x1006bd500&gt;</span></pre></div>