[Numpy-discussion] Issues to fix for 1.7.0rc2.

Charles R Harris charlesr.harris at gmail.com
Wed Feb 6 01:14:40 EST 2013


On Tue, Feb 5, 2013 at 10:23 PM, Jason Grout <jason-sage at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130205/62377890/attachment.html>


More information about the NumPy-Discussion mailing list