[Numpy-svn] r3328 - in trunk/numpy/core: include/numpy src

numpy-svn at scipy.org numpy-svn at scipy.org
Fri Oct 13 14:09:08 CDT 2006


Author: oliphant
Date: 2006-10-13 14:09:04 -0500 (Fri, 13 Oct 2006)
New Revision: 3328

Modified:
   trunk/numpy/core/include/numpy/ndarrayobject.h
   trunk/numpy/core/src/arrayobject.c
Log:
Fix ticket #341: part with 'c' arrays not being comparable to strings.

Modified: trunk/numpy/core/include/numpy/ndarrayobject.h
===================================================================
--- trunk/numpy/core/include/numpy/ndarrayobject.h	2006-10-13 18:54:02 UTC (rev 3327)
+++ trunk/numpy/core/include/numpy/ndarrayobject.h	2006-10-13 19:09:04 UTC (rev 3328)
@@ -1593,10 +1593,10 @@
 
 #define PyTypeNum_ISNUMBER(type) (type <= NPY_CLONGDOUBLE)
 
-#define PyTypeNum_ISSTRING(type) ((type == NPY_STRING) || \
-                               (type == NPY_UNICODE))
+#define PyTypeNum_ISSTRING(type) ((type == NPY_STRING) ||       \
+                                  (type == NPY_UNICODE))
 
-#define PyTypeNum_ISCOMPLEX(type) ((type >= NPY_CFLOAT) && \
+#define PyTypeNum_ISCOMPLEX(type) ((type >= NPY_CFLOAT) &&      \
                                 (type <= NPY_CLONGDOUBLE))
 
 #define PyTypeNum_ISPYTHON(type) ((type == NPY_LONG) || \

Modified: trunk/numpy/core/src/arrayobject.c
===================================================================
--- trunk/numpy/core/src/arrayobject.c	2006-10-13 18:54:02 UTC (rev 3327)
+++ trunk/numpy/core/src/arrayobject.c	2006-10-13 19:09:04 UTC (rev 3328)
@@ -4445,7 +4445,7 @@
         int val;
 
         /* Cast arrays to a common type */
-        if (self->descr->type != other->descr->type) {
+        if (self->descr->type_num != other->descr->type_num) {
                 PyObject *new;
                 if (self->descr->type_num == PyArray_STRING && \
                     other->descr->type_num == PyArray_UNICODE) {



More information about the Numpy-svn mailing list