diff options
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r-- | numpy/core/src/arrayobject.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index 9fbffb3c3..5b51b5c15 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -1118,7 +1118,7 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base) } } else { - destptr = _SOFFSET_(obj, type_num); + destptr = _SOFFSET_(obj); } /* copyswap for OBJECT increments the reference count */ copyswap(destptr, data, swap, base); @@ -7186,6 +7186,12 @@ PyArray_CanCastTo(PyArray_Descr *from, PyArray_Descr *to) stringified value of the object. */ } + if (!ret && (PyTypeNum_ISUSERDEF(fromtype) || \ + PyTypeNum_ISUSERDEF(totype))) { + /* don't restrict casting to and from + additional data-types */ + return TRUE; + } return ret; } |