From 6d8010c4654cbc7e9a04495a4401548fa47e332c Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Thu, 10 May 2007 22:42:48 +0000 Subject: Fix ticket #514 (and probably others) due to inappropriate fixing of largest string type on common type conversion. --- numpy/core/src/arrayobject.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'numpy/core/src/arrayobject.c') diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index 3b8c71226..3e4e7f666 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -6937,15 +6937,13 @@ _array_small_type(PyArray_Descr *chktype, PyArray_Descr* mintype) else { outtype = PyArray_DescrFromType(outtype_num); } - if (PyTypeNum_ISEXTENDED(outtype->type_num) && \ - (PyTypeNum_ISEXTENDED(mintype->type_num) || \ - mintype->type_num==0)) { + if (PyTypeNum_ISEXTENDED(outtype->type_num)) { int testsize = outtype->elsize; register int chksize, minsize; chksize = chktype->elsize; minsize = mintype->elsize; /* Handle string->unicode case separately - because string itemsize is twice as large */ + because string itemsize is 4* as large */ if (outtype->type_num == PyArray_UNICODE && mintype->type_num == PyArray_STRING) { testsize = MAX(chksize, 4*minsize); -- cgit v1.2.1