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

numpy-svn at scipy.org numpy-svn at scipy.org
Wed Oct 11 14:10:54 CDT 2006


Author: oliphant
Date: 2006-10-11 14:10:51 -0500 (Wed, 11 Oct 2006)
New Revision: 3309

Modified:
   trunk/numpy/core/src/multiarraymodule.c
Log:
Make (type,()) return type

Modified: trunk/numpy/core/src/multiarraymodule.c
===================================================================
--- trunk/numpy/core/src/multiarraymodule.c	2006-10-11 11:25:58 UTC (rev 3308)
+++ trunk/numpy/core/src/multiarraymodule.c	2006-10-11 19:10:51 UTC (rev 3309)
@@ -4249,9 +4249,10 @@
 					"invalid shape in fixed-type tuple.");
 			goto fail;
 		}
-		/* If (type, 1) was given, it is equivalent to type... */
-		if (shape.len == 1 && shape.ptr[0] == 1 && \
-		    PyNumber_Check(val)) {
+		/* If (type, 1) was given, it is equivalent to type... 
+                   or (type, ()) was given it is equivalent to type... */
+		if ((shape.len == 1 && shape.ptr[0] == 1 && PyNumber_Check(val)) || \
+                    (shape.len == 0 && PyTuple_Check(val))) {
 			PyDimMem_FREE(shape.ptr);
 			return type;
 		}



More information about the Numpy-svn mailing list