[Numpy-svn] r8154 - trunk/numpy/core/src/multiarray

numpy-svn at scipy.org numpy-svn at scipy.org
Sat Feb 20 13:10:21 EST 2010


Author: ptvirtan
Date: 2010-02-20 12:10:21 -0600 (Sat, 20 Feb 2010)
New Revision: 8154

Modified:
   trunk/numpy/core/src/multiarray/scalartypes.c.src
Log:
3K: ENH: on py3k, rename scalar type display names as unicode_ -> str_ and string_ -> bytes_

Modified: trunk/numpy/core/src/multiarray/scalartypes.c.src
===================================================================
--- trunk/numpy/core/src/multiarray/scalartypes.c.src	2010-02-20 18:10:04 UTC (rev 8153)
+++ trunk/numpy/core/src/multiarray/scalartypes.c.src	2010-02-20 18:10:21 UTC (rev 8154)
@@ -2912,6 +2912,16 @@
 }
 
 
+#define NAME_bool "bool"
+#define NAME_void "void"
+#if defined(NPY_PY3K)
+#define NAME_string "bytes"
+#define NAME_unicode "str"
+#else
+#define NAME_string "string"
+#define NAME_unicode "unicode"
+#endif
+
 /**begin repeat
  * #name = bool, string, unicode, void#
  * #NAME = Bool, String, Unicode, Void#
@@ -2924,7 +2934,7 @@
     PyObject_HEAD_INIT(NULL)
     0,                                          /* ob_size */
 #endif
-    "numpy. at name@@ex@",                         /* tp_name*/
+    "numpy." NAME_ at name@ "@ex@",                /* tp_name*/
     sizeof(Py at NAME@ScalarObject),               /* tp_basicsize*/
     0,                                          /* tp_itemsize */
     0,                                          /* tp_dealloc */
@@ -2979,6 +2989,11 @@
 };
 /**end repeat**/
 
+#undef NAME_bool
+#undef NAME_void
+#undef NAME_string
+#undef NAME_unicode
+
 /**begin repeat
  * #NAME = Byte, Short, Int, Long, LongLong, UByte, UShort, UInt, ULong,
  *         ULongLong, Float, Double, LongDouble, Datetime, Timedelta#




More information about the Numpy-svn mailing list