[Numpy-svn] r2963 - trunk/numpy/oldnumeric

numpy-svn at scipy.org numpy-svn at scipy.org
Sat Aug 5 02:01:56 CDT 2006


Author: oliphant
Date: 2006-08-05 02:01:54 -0500 (Sat, 05 Aug 2006)
New Revision: 2963

Modified:
   trunk/numpy/oldnumeric/typeconv.py
Log:
Alter typeconv to ignore 'b'

Modified: trunk/numpy/oldnumeric/typeconv.py
===================================================================
--- trunk/numpy/oldnumeric/typeconv.py	2006-08-05 06:44:20 UTC (rev 2962)
+++ trunk/numpy/oldnumeric/typeconv.py	2006-08-05 07:01:54 UTC (rev 2963)
@@ -5,32 +5,40 @@
 
 oldtype2dtype = {'1': N.dtype(N.byte),
                  's': N.dtype(N.short),
-                 'i': N.dtype(N.intc),
-                 'l': N.dtype(int),
-                 'b': N.dtype(N.ubyte),
+#                 'i': N.dtype(N.intc),
+#                 'l': N.dtype(int),
+#                 'b': N.dtype(N.ubyte),
                  'w': N.dtype(N.ushort),
                  'u': N.dtype(N.uintc),
-                 'f': N.dtype(N.single),
-                 'd': N.dtype(float),
-                 'F': N.dtype(N.csingle),
-                 'D': N.dtype(complex),
-                 'O': N.dtype(object),
-                 'c': N.dtype('c'),
+#                 'f': N.dtype(N.single),
+#                 'd': N.dtype(float),
+#                 'F': N.dtype(N.csingle),
+#                 'D': N.dtype(complex),
+#                 'O': N.dtype(object),
+#                 'c': N.dtype('c'),
                  None:N.dtype(int)
     }
 
+# converts typecode=None to int
 def convtypecode(typecode, dtype=None):
     if dtype is None:
         try:
             return oldtype2dtype[typecode]
         except:
             return N.dtype(typecode)
+    else:
+        return dtype
 
+#if both typecode and dtype are None
+#  return None
 def convtypecode2(typecode, dtype=None):
-    if typecode is None and dtype is None:
-        return None
-    elif dtype is None:
-        try:
-            return oldtype2dtype[typecode]
-        except:
-            return N.dtype(typecode)
+    if dtype is None:
+        if typecode is None:
+            return None
+        else:
+            try:
+                return oldtype2dtype[typecode]
+            except:
+                return N.dtype(typecode)
+    else:
+        return dtype



More information about the Numpy-svn mailing list