surprising result all (generator) (bug??)

Neal Becker ndbecker2 at gmail.com
Tue Jan 31 08:24:38 EST 2012


Mark Dickinson wrote:

> 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
In [31]: all is numpy.all
Out[31]: True

Excellent detective work, Mark!  But it still is unexpected, at least to me.




More information about the Python-list mailing list