[Numpy-discussion] Bug in numpy all() function

2008-02-06 Thread Dan Goodman
Hi all, I think this is a bug (I'm running Numpy 1.0.3.1): from numpy import * def f(x): return False all(f(x) for x in range(10)) True I guess the all function doesn't know about generators? Dan ___ Numpy-discussion mailing list

Re: [Numpy-discussion] Bug in numpy all() function

2008-02-06 Thread Ryan May
Dan Goodman wrote: Hi all, I think this is a bug (I'm running Numpy 1.0.3.1): from numpy import * def f(x): return False all(f(x) for x in range(10)) True I guess the all function doesn't know about generators? That's likely the problem. However, as of Python 2.5, there's a

Re: [Numpy-discussion] Bug in numpy all() function

2008-02-06 Thread Robert Kern
Dan Goodman wrote: Hi all, I think this is a bug (I'm running Numpy 1.0.3.1): from numpy import * def f(x): return False all(f(x) for x in range(10)) True I guess the all function doesn't know about generators? Yup. It works on arrays and things it can turn into arrays by calling

Re: [Numpy-discussion] Bug in numpy all() function

2008-02-06 Thread Anne Archibald
On 06/02/2008, Robert Kern [EMAIL PROTECTED] wrote: I guess the all function doesn't know about generators? Yup. It works on arrays and things it can turn into arrays by calling the C API equivalent of numpy.asarray(). There's a ton of magic and special cases in asarray() in order to

Re: [Numpy-discussion] Bug in numpy all() function

2008-02-06 Thread Robert Kern
Anne Archibald wrote: On 06/02/2008, Robert Kern [EMAIL PROTECTED] wrote: I guess the all function doesn't know about generators? Yup. It works on arrays and things it can turn into arrays by calling the C API equivalent of numpy.asarray(). There's a ton of magic and special cases in