diff options
author | David Cournapeau <cournape@gmail.com> | 2008-10-05 07:00:33 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-10-05 07:00:33 +0000 |
commit | 50d1e8edc57b51a42cd82c9ef74a8e799ed36801 (patch) | |
tree | ccaba8c6f96b3ac715d5ad56ef3b34093778d9a5 /numpy/core/src/ufuncobject.c | |
parent | 0273ac8609ab82eaa4240c437083bfeb5b707e29 (diff) | |
parent | a0e082a087e9667e3805d3be859958a292e8f336 (diff) | |
download | numpy-50d1e8edc57b51a42cd82c9ef74a8e799ed36801.tar.gz |
Merged revisions 5882-5911 via svnmerge from
http://svn.scipy.org/svn/numpy/trunk
........
r5886 | charris | 2008-10-02 03:05:29 +0900 (Thu, 02 Oct 2008) | 4 lines
Make some error messages more informative.
Improve error handling.
Make continuation lines work.
........
r5887 | charris | 2008-10-02 03:06:04 +0900 (Thu, 02 Oct 2008) | 2 lines
Small cleanup to clarify repeated string.
........
r5888 | charris | 2008-10-02 03:08:41 +0900 (Thu, 02 Oct 2008) | 6 lines
Cleanup ufunc loops.
At this point loops are separated into variable kinds, so there is a fair amount
of duplication. I will probably merge loops that look the same in a later
commit. There are no changes to current behavior of loops, this will also be
changed in later work to deal with nans and such.
........
r5889 | oliphant | 2008-10-03 05:27:17 +0900 (Fri, 03 Oct 2008) | 1 line
Fix problem with subclasses of object arrays.
........
r5896 | cdavid | 2008-10-03 15:50:32 +0900 (Fri, 03 Oct 2008) | 1 line
Update the minimum version for numscons: had to change to cope with Chuck changes to conv_template.py.
........
r5897 | cdavid | 2008-10-03 15:51:03 +0900 (Fri, 03 Oct 2008) | 1 line
Update doall script: take the python version to build binaries from the command line instead of global variable.
........
r5906 | oliphant | 2008-10-04 00:55:52 +0900 (Sat, 04 Oct 2008) | 1 line
Fix ticket #925
........
Diffstat (limited to 'numpy/core/src/ufuncobject.c')
-rw-r--r-- | numpy/core/src/ufuncobject.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/numpy/core/src/ufuncobject.c b/numpy/core/src/ufuncobject.c index fd14936a8..ab4ecef75 100644 --- a/numpy/core/src/ufuncobject.c +++ b/numpy/core/src/ufuncobject.c @@ -1427,12 +1427,15 @@ construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps, * FAIL with NotImplemented if the other object has * the __r<op>__ method and has __array_priority__ as * an attribute (signalling it can handle ndarray's) - * and is not already an ndarray + * and is not already an ndarray or a subtype of the same type. */ if ((arg_types[1] == PyArray_OBJECT) && \ (loop->ufunc->nin==2) && (loop->ufunc->nout == 1)) { PyObject *_obj = PyTuple_GET_ITEM(args, 1); - if (!PyArray_CheckExact(_obj) && \ + if (!PyArray_CheckExact(_obj) && + /* If both are same subtype of object arrays, then proceed */ + !(_obj->ob_type == (PyTuple_GET_ITEM(args, 0))->ob_type) && \ + PyObject_HasAttrString(_obj, "__array_priority__") && \ _has_reflected_op(_obj, loop->ufunc->name)) { loop->notimplemented = 1; |