summaryrefslogtreecommitdiff
path: root/numpy/core/src/arrayobject.c
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2007-05-10 22:42:48 +0000
committerTravis Oliphant <oliphant@enthought.com>2007-05-10 22:42:48 +0000
commit6d8010c4654cbc7e9a04495a4401548fa47e332c (patch)
tree53111cd2e262a883d9cf995206cc8f021e52a855 /numpy/core/src/arrayobject.c
parentae13dc354df5e58fb1417ba80fc9c85242224caf (diff)
downloadnumpy-6d8010c4654cbc7e9a04495a4401548fa47e332c.tar.gz
Fix ticket #514 (and probably others) due to inappropriate fixing of largest string type on common type conversion.
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r--numpy/core/src/arrayobject.c6
1 files changed, 2 insertions, 4 deletions
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);