On Tue, Feb 5, 2013 at 10:23 PM, Jason Grout <jason-s...@creativetrax.com>wrote:
> On 2/4/13 12:04 AM, Ondřej Čertík wrote: > > Hi, > > > > Here are the last open issues for 1.7, there are 9 of them: > > > > > https://github.com/numpy/numpy/issues?milestone=3&sort=updated&state=open > > > > Here's something we noticed while working on getting 1.7rc1 into Sage > with one of our doctests. With numpy 1.5.1 (we skipped 1.6.x because of > backwards compatibility issues...): > > import numpy as np > print np.array([None, None]).any() > > prints False, but with 1.7.rc1, we get None. > > For comparison, in Python 2.6.1 and 3.3.0: > > >>> any([None,None]) > False > >>> print None or None > None > > Was this change between 1.5.1 and 1.7 intentional? > > Probably not, but maybe yes. I'd guess the cause is lines 2601-2603 of ufunc_object.c if (PyArray_ISOBJECT(arr) && PyArray_SIZE(arr) != 0) { assign_identity = NULL; } The variable assign_identity is a function pointer, so some new functions are probably needed that return python integers 0 and 1 when PyUFunc_Zero and PyUFunc_One turn up. I don't know what all the consequences of that change would be and it may not be quite so simple. Clearly that code isn't well tested. Chuck
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion