[Numpy-discussion] failure to register ufunc loops for user defined types

Charles R Harris charlesr.harris at gmail.com
Sun Dec 4 20:18:39 EST 2011


On Sun, Dec 4, 2011 at 5:41 PM, Geoffrey Irving <irving at naml.us> wrote:

> This may be the problem.  Simple diffs are pleasant.  I'm guessing
> this code doesn't get a lot of testing.  Glad it's there, though!
>
> Geoffrey
>
> diff --git a/numpy/core/src/umath/ufunc_type_resolution.c
> b/numpy/core/src/umath/ufunc_type_resolution.c
> index 0d6cf19..a93eda1 100644
> --- a/numpy/core/src/umath/ufunc_type_resolution.c
> +++ b/numpy/core/src/umath/ufunc_type_resolution.c
> @@ -1866,7 +1866,7 @@ linear_search_type_resolver(PyUFuncObject *self,
>             case -1:
>                 return -1;
>             /* A loop was found */
> -            case 1:
> +            case 0:
>                 return 0;
>          }
>     }
>
>
Heh. Can you verify that this fixes the problem? That function is only
called once  and its return value is passed up the chain, but the
documented return values of that calling function are -1, 0. So the
documentation needs to be changed if this is the right thing to do.

Speaking of tests... I was wondering if you could be talked into putting
together a simple user type for including in the tests?

<snip>

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20111204/a99125f7/attachment.html>


More information about the NumPy-Discussion mailing list