[Numpy-svn] r3621 - trunk/numpy/core/src

numpy-svn@scip... numpy-svn@scip...
Fri Mar 30 13:25:17 CDT 2007


Author: oliphant
Date: 2007-03-30 13:25:12 -0500 (Fri, 30 Mar 2007)
New Revision: 3621

Modified:
   trunk/numpy/core/src/arraymethods.c
   trunk/numpy/core/src/arrayobject.c
Log:
Change 0-d record arrays so that field selection returns a 0-d array and not a scalar.

Modified: trunk/numpy/core/src/arraymethods.c
===================================================================
--- trunk/numpy/core/src/arraymethods.c	2007-03-30 18:19:07 UTC (rev 3620)
+++ trunk/numpy/core/src/arraymethods.c	2007-03-30 18:25:12 UTC (rev 3621)
@@ -264,7 +264,7 @@
 					 PyArray_DescrConverter,
 					 &dtype, &offset)) return NULL;
 
-	return _ARET(PyArray_GetField(self, dtype, offset));
+	return PyArray_GetField(self, dtype, offset);
 }
 
 

Modified: trunk/numpy/core/src/arrayobject.c
===================================================================
--- trunk/numpy/core/src/arrayobject.c	2007-03-30 18:19:07 UTC (rev 3620)
+++ trunk/numpy/core/src/arrayobject.c	2007-03-30 18:25:12 UTC (rev 3621)
@@ -3042,7 +3042,7 @@
 
         if (mp->nd == 0) {
                 Bool noellipses = TRUE;
-                if (op == Py_Ellipsis)
+                if ((op == Py_Ellipsis) || PyString_Check(op) || PyUnicode_Check(op))
                         noellipses = FALSE;
                 else if (PyBool_Check(op) || PyArray_IsScalar(op, Bool) || 
                          (PyArray_Check(op) && (PyArray_DIMS(op)==0) &&



More information about the Numpy-svn mailing list