surprising result all (generator) (bug??)

Mark Dickinson mdickinson at enthought.com
Tue Jan 31 07:44:02 EST 2012


On Jan 31, 6:40 am, Neal Becker <ndbeck... at gmail.com> wrote:
> I was just bitten by this unexpected behavior:
>
> In [24]: all ([i > 0 for i in xrange (10)])
> Out[24]: False
>
> In [25]: all (i > 0 for i in xrange (10))
> Out[25]: True

What does:

>>> import numpy
>>> all is numpy.all

give you?

--
Mark



More information about the Python-list mailing list