[Numpy-svn] r3220 - trunk/numpy/core

numpy-svn at scipy.org numpy-svn at scipy.org
Wed Sep 27 12:01:46 CDT 2006


Author: oliphant
Date: 2006-09-27 12:01:35 -0500 (Wed, 27 Sep 2006)
New Revision: 3220

Modified:
   trunk/numpy/core/numerictypes.py
Log:
Fix so that 'i4' and 'int32' are allways inserted into sctypeDict together. 

Modified: trunk/numpy/core/numerictypes.py
===================================================================
--- trunk/numpy/core/numerictypes.py	2006-09-26 22:39:14 UTC (rev 3219)
+++ trunk/numpy/core/numerictypes.py	2006-09-27 17:01:35 UTC (rev 3220)
@@ -171,7 +171,7 @@
         typeobj = typeinfo[a][-1]
         # insert bit-width version for this class (if relevant)
         base, bit, char = bitname(typeobj)
-        if base[-3:] == 'int': continue
+        if base[-3:] == 'int' or char[0] in 'ui': continue
         if base != '':
             myname = "%s%d" % (base, bit)
             if (name != 'longdouble' and name != 'clongdouble') or \
@@ -209,6 +209,8 @@
     for ctype in _ctypes:
         val = typeinfo[ctype]
         bits = val[2]
+        charname = 'i%d' % (bits/8,)
+        ucharname = 'u%d' % (bits/8,)
         intname = 'int%d' % bits
         UIntname = 'UInt%d' % bits
         Intname = 'Int%d' % bits
@@ -223,6 +225,8 @@
             sctypeDict[uintname] = utypeobj
             sctypeDict[Intname] = typeobj
             sctypeDict[UIntname] = utypeobj
+            sctypeDict[charname] = typeobj
+            sctypeDict[ucharname] = utypeobj
             sctypeNA[Intname] = typeobj
             sctypeNA[UIntname] = utypeobj
         sctypeNA[typeobj] = Intname



More information about the Numpy-svn mailing list